my own error messages (1 Viewer)

deekras

Registered User.
Local time
Today, 10:13
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.
 

pdx_man

Just trying to help
Local time
Today, 02:13
Joined
Jan 23, 2001
Messages
1,347
Form event On Error. Here you can do error trapping.

ie
if err.number = 3051 then msgbox "Hey! That's not right"
 

deekras

Registered User.
Local time
Today, 10:13
Joined
Jun 14, 2000
Messages
169
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

Top Bottom