S
ScardyBob
Hello All!
I was wondering if it is possible set an object to a variable within a
For.. Next... Loop. For example:
(This doesn't work but is essentially what I want to do)
i = 0
For Each ctrl In frm.Controls
If ctrl.ControlType = acSubform Then
Set subctrl & i = ctrl
i = i + 1
End If
Next ctrl
The main idea of this is to loop through all the controls, selecting
only the subform controls, and assigning them to incremented variable
(subctrl1, subctrl2, subctrl3, etc.) via the Set statement within the
For... Next... Loop. Is this, or something like it, possible? Or do I
have to set each variable manually.
Thanks in Advance!
Mike
I was wondering if it is possible set an object to a variable within a
For.. Next... Loop. For example:
(This doesn't work but is essentially what I want to do)
i = 0
For Each ctrl In frm.Controls
If ctrl.ControlType = acSubform Then
Set subctrl & i = ctrl
i = i + 1
End If
Next ctrl
The main idea of this is to loop through all the controls, selecting
only the subform controls, and assigning them to incremented variable
(subctrl1, subctrl2, subctrl3, etc.) via the Set statement within the
For... Next... Loop. Is this, or something like it, possible? Or do I
have to set each variable manually.
Thanks in Advance!
Mike