How can I access a control array object as an item on a form, vs. explicitly by name?
e.g. I have a TextBox "Text1", with index=0 on a form (that's it)
but the following code fails with Error 344, "Must specify index for object array"
Code:Dim xx As Object For Each xx In Me.Controls Load xx(1) Next xx
FWIW
Load Text1(1) works fine.
? TypeName(Text1) = Object
? TypeName(xx) = TextBox
Apparently, in the For Each loop it's giving me actual instances of the textbox control, rather than the control array itself.
Thanks, DaveBo




Reply With Quote