my own error messages

deekras

Registered User.
Local time
Today, 20:23
Joined
Jun 14, 2000
Messages
169
i would like to use my own message when the data entered is a duplicate of previous information. (I would like to unique account numbers). Right now Access sends its own message.
any suggestions.
 
Form event On Error. Here you can do error trapping.

ie
if err.number = 3051 then msgbox "Hey! That's not right"
 
i tried it. doesn't seem to work.
this is the coding i used.


Private Sub Form_Error(DataErr As Integer, Response As Integer)
If Err.Number = 3051 Then MsgBox "That account number is already used. Try another account number.", 0, "Duplicate"

End Sub

did i put it in the wrong place?


ALSO. where can i find a list of error messages adn their numbers?
 

Users who are viewing this thread

Back
Top Bottom