I'm trying to loop through all the controls in my form and for each time it catches a Label, the Tag element of the Label is added into the array.
Dim labelCounter As Integer
labelCounter = 0
Dim arrayTag() As String
For Each ctl In Me.Controls
Select Case TypeName(ctl)
Case "Label"
arrayTag(labelCounter) = ctl.Tag
labelCounter = labelCounter + 1
End Select
Next
I keep getting the Subscript out of range error. What's going wrong here?
Best Answer