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
error on second loop
You do not have the required permissions to view the files attached to this post.
Private Sub TEST_SAL21()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeName(ctl) = "ComboBox" Then
If Not ctl.Container Is Nothing Then
If ctl.Container.Name = "Frame2" Then
If Val(ctl.Tag) >= 1 Then
' Do something with ctl
Debug.Print ctl.Name
End If
End If
End If
End If
Next ctl
End Sub
Private Sub TEST_SAL21()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeName(ctl) = "ComboBox" Then
If Not ctl.Container Is Nothing Then
If ctl.Container.Name = "Frame2" Then
If Val(ctl.Tag) >= 1 Then
' Do something with ctl
Debug.Print ctl.Name
End If
End If
End If
End If
Next ctl
End Sub