How to customize error message

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

I have a field that is indexed that does not all
duplicate and I am wanting to change the error message if
this is possible can someone give the procedure to do
this..
Thank in advance
 
Raj said:
I have a field that is indexed that does not all
duplicate and I am wanting to change the error message if
this is possible can someone give the procedure to do
this..
Thank in advance

You can set up an event procedure for the form's Error event, along
these lines:

'----- start of example code -----
Private Sub Form_Error(DataErr As Integer, Response As Integer)

If DataErr = 3022 Then
MsgBox "Sorry, you've tried to add a value that already exists."
Response = acDataErrContinue
End If

End Sub

'----- end of example code -----

Unfortunately, if there is more than one field on the form for which
this error might have been raised, I don't know any way to tell which
one it was.
 
Back
Top