I'm trying to distinguish between textboxes that are in control arrays and those that aren't in control arrays on a form. If Text1 is not a control array and Text2 is a control array I can do
ControlType1 will have the value "TextBox" and ControlType2 will have the value "Object" . This is great and the results that I want but since I have many TextBox's to process so I wanted to do:
The problem is when I process the textbox control arrays in the for each loop, instead of TypeName returning "Object" it returns "TextBox" just like the TextBox's that aren't in a control array. Is there another way to do this?
Code:
Dim ControlType1 as string
Dim ControlType2 as string
ControlType1 = TypeName(Text1)
ControlType2 = TypeName(Text2)
Code:
Dim ControlType As String
Dim MyControl as Control
For Each MyControl In Form1
ControlType = TypeName(MyControl)
if ControlType = "Object"
Do something here
End If
Next MyControl