required fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HELLO
Some body know how to create a message when i dont write in a field required.
 
Firstly enter data only via a form. In the form's BeforeUpdate event
procedure show a message box if the control bound to the field is Null and
cancel the update, e.g.

If IsNull(Me.[YourControlName]) Then
MsgBox "Data must be entered in field X.", vbExclamation, "Invalid
Operation"
Cancel = True
End If

Ken Sheridan
Stafford, England
 
Use the OnExit event of the field...

Private Sub SomeField_Exit(Cancel as Integer)
If IsNull([SomeField]) Then
Beep
MsgBox "Entry Is Required"
Cancel = True
DoCmd.GoToControl "SomeField"
End If
End Sub

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

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

Back
Top