Error Number for Duplicate Record

D

Daniel

When adding a record and it turns out to be duplicate when
the form is closed? What is the error number? Can code be
written "If Error = 123245 then
MsgBox 'This is the error'
Resume Next
End if"

Thanks

Dan
 
A

Allen Browne

Use the Error event of the form, and trap DataErr 3022.

You may also wish to trap:
3201 Related record required;
3314 Required field missing;
2113 Invalid data type.
 

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