Change Error Message

  • Thread starter chopper57 via AccessMonster.com
  • Start date
C

chopper57 via AccessMonster.com

How do you change a default Erorr Message, this is the message that I get:

"The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship.
Change the data in the field or fields that contain duplicate data, remove
the index, or redefine the index to permit duplicate entries and try again."

I have a index on two Fields in the table so I don't have duplicates. I
would like a simple message that says the number is already used. I have
tried the following but still get the default message and the new message
pops up only when I close the form.

If DataErr = 3022 Then
Response = acDataErrContinue ' Don't display the default message
MsgBox "Number already used."
Else
MsgBox "Error#: " & DataErr
Response = acDataErrDisplay ' Display Default message
End If
 
D

Douglas J. Steele

Did you remember to put On Error Resume Next, or On Error Goto Label, and
put that code you're showing after Label?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top