Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Msgbox when field is required

Status
Not open for further replies.

Duffymk

Programmer
Sep 28, 2001
6
GB
Hello -

I have a field called 'Date' which has been set to Required in the table settings. I also have a data-entry form used to populate this table. If the user tries to move to the next record while leaving 'Date' null, the usual message box pops up telling them they must enter a value. Is there a way to customise this message box?

Thanks! MD
 
Yup, you need to add some code in the forms error event:

Private Sub Form_Error(DataErr As Integer, Response As Integer)

If DataErr = 3314 Then
MsgBox "Custom message here!"
Response = acDataErrContinue
End If

End Sub


Err.Number 3314 is the error message you are wanting to trap AFAIK

James Goodman MCSE, MCDBA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top