Customizing an Error Message

G

Guest

Using an old database in Access 97

How do I capture the error message #3314 that results when user enters
duplicate OHC# (primary key)?

In my custom message box can I add some code that will allow user to search
for the original record based on that OHC#.
 
G

Guest

You just need to add an error handler to the procedure where this happens.
When an error occurs, base your message box text on the error received.
If you are not including an errorhandler in every procedure you write, go
to the blackboard and write "I will never write another sub or function
without an error handler again" 100 times :)
 
G

Guest

DB Diva,
If I am guressing correctly, you are getting the system message for a
duplicate error. It would be my guess to use a procedure on the BeforeUpdate
of the primary key field to identify this. Then, as suggested, you can
handle the error.
 

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