Customizing an Error Message

  • Thread starter Thread starter Guest
  • Start date Start date
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#.
 
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 :)
 
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.
 
Back
Top