J
john
From http://www.databasedev.co.uk/custom-error-message.html I use:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
'If an error occurs because of missing data in a required field
'display our own custom error message
Const conErrRequiredData = 3314
If DataErr = conErrRequiredData Then
MsgBox ("Please ensure that you enter a First Name and Last Name")
Response = acDataErrContinue
Else
'Display a standard error message
Response = acdatadisplay
End If
End Sub
I tested it with the error code 3022 (double values). The strange thing is
that the custom message is shown, but that all other errors don't result in
the standard messages or any other message. When I omit the else clause, it
seems to be working fine. Custum message is shown for 3022 and the other
error's standard messages are shown as well.
Is something wrong with the above code or am I doing something wrong?
Thanks in advance,
John
Private Sub Form_Error(DataErr As Integer, Response As Integer)
'If an error occurs because of missing data in a required field
'display our own custom error message
Const conErrRequiredData = 3314
If DataErr = conErrRequiredData Then
MsgBox ("Please ensure that you enter a First Name and Last Name")
Response = acDataErrContinue
Else
'Display a standard error message
Response = acdatadisplay
End If
End Sub
I tested it with the error code 3022 (double values). The strange thing is
that the custom message is shown, but that all other errors don't result in
the standard messages or any other message. When I omit the else clause, it
seems to be working fine. Custum message is shown for 3022 and the other
error's standard messages are shown as well.
Is something wrong with the above code or am I doing something wrong?
Thanks in advance,
John