I have been trying to figure this out off and on for many months now and there has to be a way.
Assume I have activex checkboxes named A1-A10.
This works:
This DOES NOT work:
This is the only syntax I can find on the web after months of searching. I have tried all types of other ways but I am seriously missing something here. It would seem this type of variable referencing should be straightforward. No? LOL
The point is I want to use a loop such as this:
Help! Dave
Assume I have activex checkboxes named A1-A10.
This works:
Code:
Private Sub thisworks()
If Me.A1.Value = True Then
MsgBox "It's true"
End If
End Sub
This DOES NOT work:
Code:
Private Sub thisdoesnotwork()
myCtrl = "A1"
If Me(myCtrl).Value = True Then
MsgBox "It's true"
End If
End Sub
This is the only syntax I can find on the web after months of searching. I have tried all types of other ways but I am seriously missing something here. It would seem this type of variable referencing should be straightforward. No? LOL
The point is I want to use a loop such as this:
Code:
Private Sub usealoop()
For myCtrl = 1 to 10
myCtrl = "A" & myCtrl
If Me(myCtrl).Value = True Then
MsgBox "It's true"
End If
Next
End Sub
Help! Dave
Last edited: