Displaying message on error

D

Dan

I receive the message "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 just want to have a simple message box pop up when the
user tries to insert a duplicate record.
 
D

Dan

Sorry I just figured it out

If you use an if statement with something like:

if Err.discription = 3022 Then
msgbox "Your message"
End If
 
K

Karen

If you are updating the records in a form, you can set the
On Error property to pop up your message box. You;ll have
to build the event, but that's not too hard.
 

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