E
Etienne Bar
Hi,
I need to find in a form all labels corresponding to textboxes and change
their caption.
For reasons too complex to explain here (the labels are stored in a separate
table for easy changes and translations), i can't use the caption property
in the tables or queries...
So, i use this code :
Sub Test_Form(MyForm As Form)
Dim ctl As Control ' The textbox
Dim ctlLabel As Control
For Each ctl In MyForm.Controls
If ctl.ControlType = acTextBox Then
' set ctlLabel = the label corresponding to the control <== Here
what's i'am looking for !
' TheLabel.caption = my new label
End If
Next ctl
End Sub
my question is : what is the good way to find the label corresponding to ctl
?
Thanks for your answers and excuse me for my poor english...
I need to find in a form all labels corresponding to textboxes and change
their caption.
For reasons too complex to explain here (the labels are stored in a separate
table for easy changes and translations), i can't use the caption property
in the tables or queries...
So, i use this code :
Sub Test_Form(MyForm As Form)
Dim ctl As Control ' The textbox
Dim ctlLabel As Control
For Each ctl In MyForm.Controls
If ctl.ControlType = acTextBox Then
' set ctlLabel = the label corresponding to the control <== Here
what's i'am looking for !
' TheLabel.caption = my new label
End If
Next ctl
End Sub
my question is : what is the good way to find the label corresponding to ctl
?
Thanks for your answers and excuse me for my poor english...