Have you tried something like this:
For Each Ctrl In Controls
If TypeOf Ctrl Is msforms.TextBox Then
If TypeOf Ctrl.Parent Is msforms.Page Then
If Ctrl.Value = "" And Ctrl.Visible = True And Ctrl.Enabled = True Then
Ctrl.BackColor = vbYellow
Ctrl.Parent.Parent.Value = Ctrl.Parent.Index
Ctrl.SetFocus
MsgBox Ctrl.Name & " is required.", vbOKOnly, "Missing Item"
Exit Sub
End If
Else
If Ctrl.Value = "" And Ctrl.Visible = True And Ctrl.Enabled = True Then
Ctrl.BackColor = vbYellow
MsgBox Ctrl.Name & " is required.", vbOKOnly, "Missing Item"
Ctrl.SetFocus
Exit Sub
End If
End If
End If
Next Ctrl
hth
Bookmarks