Thanks and this is exactly what I am facing too. In my system, I control all error and display error messages using codes. I would to like do the same for standardization.
Any idea?
You can find the error number by simply coding the Form's Error event:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
MsgBox DataErr
Response = acDataErrContinue
End Sub
Open the form and intentionally create that Date entry error.
Then change that code to trap the error (which is 2113) in the Form's
Error event:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 2113 Then
MsgBox "Please enter a valid date"
Response = acDataErrContinue
End If
End Sub