W
WillRn
I have a complex userform that I would like to be checked for blank entries
upon posting. The following code does great as long as I am just looking at
Textboxes or just one kind of control.
Dim ctl
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If ctl.Text = "" Then
MsgBox "Missing answer, please complete"
ctl.SetFocus
Exit For
End If
End If
Next ctl
However, my user form has several comboboxes and several groups of
OptionButtons (Yes, No, NA) that I would like checked also. Is there any way
to check everything on the page at once?
WillRn
upon posting. The following code does great as long as I am just looking at
Textboxes or just one kind of control.
Dim ctl
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If ctl.Text = "" Then
MsgBox "Missing answer, please complete"
ctl.SetFocus
Exit For
End If
End If
Next ctl
However, my user form has several comboboxes and several groups of
OptionButtons (Yes, No, NA) that I would like checked also. Is there any way
to check everything on the page at once?
WillRn