Code: Select all
Private Sub TEST_HANS()
Dim ctl As Control
For Each ctl In Me.Controls
If Not ctl.Container Is Nothing Then'<<<<<<< here error
If ctl.Container.Name = "Frame2" Then
If TypeName(ctl) = "ComboBox" And Val(ctl.Tag) >= 1 Then
' Do something with ctl
Debug.Print ctl.Name
End If
End If
End If
Next ctl
End Sub