Check blank in user form



Dim ctl

For Each ctl In Me.Controls

     Select Case TypeName(ctl)

          Case  "TextBox", "ComboBox"

                If ctl.Text = "" Then
                      MsgBox "Missing answer, please complete"
                      ctl.SetFocus
                      Exit For
                End If

         Case "OptionButton"
             
              ' put code here to validate the option button

       End Select
           
Next ctl