Message to pop up when required field is tabbed thru w/o data

  • Thread starter Thread starter Jan Little
  • Start date Start date
J

Jan Little

I have a required field in a form and would like for the
user to be notified via a pop up message notifying the
user that this is a required field. I have tried using
the validation rule, but have not succeeded. Help,
please, and thanks.
 
Click the Build Event of the form and add some code like
this to a command button:

Option Compare Database
Option Explicit

Private Sub cmdOk_Click()

txtFieldName.SetFocus
gstrFieldName = txtFieldName.Text
If IsNull(txtFieldName) Then
MsgBox "You must enter the Field Name"
Exit Sub
End If

DoCmd.Close

End Sub
 
Back
Top