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

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.
 
B

Bart

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top