I was wondering how to reference and update control on a form from a module without explicitly knowning the control name. For example, if I have a bunch of controls:
Forms!myForm!Control1
Forms!myForm!Control2
...
How could I loop through them to set their values using a for/next loop? This obviously does not work:
Dim i as Integer
For i = 1 to 50
("Forms!myForm!Control" & i) = "MyValue"
Next
I don't want to be forced to set each control:
Dim ctlMyControl as Control
Set ctlMyControl = Forms!myForm!Control1 ... etc.
I though of using the Eval() function...that returns the value but not the control reference. Any other ideas?
Thanks - Brian
Forms!myForm!Control1
Forms!myForm!Control2
...
How could I loop through them to set their values using a for/next loop? This obviously does not work:
Dim i as Integer
For i = 1 to 50
("Forms!myForm!Control" & i) = "MyValue"
Next
I don't want to be forced to set each control:
Dim ctlMyControl as Control
Set ctlMyControl = Forms!myForm!Control1 ... etc.
I though of using the Eval() function...that returns the value but not the control reference. Any other ideas?
Thanks - Brian