Error trapping in Access 2002

S

scuba1392

I want to trap for "error 3201 - you cannot add or change a record". This
occurs when a transaction is being added to a table that captures all
transactions for a part master table. The transaction table is linked to the
part master table as a 1 to many relationship with referential integrity.
What event or where should I put the code to trap this error to present other
options to the application user?
 
T

Tom van Stiphout

On Mon, 13 Apr 2009 06:48:03 -0700, scuba1392

The Form_Error event comes to mind :)

-Tom.
Microsoft Access MVP
 
S

scuba1392

Tom, I put the floowing code into the Form_Error event; however, it never
took the "OnError" path - is it coded properly ?

Private Sub Form_Error(DataErr As Integer, Response As Integer)
MsgBox "this is the form error event"
On Error GoTo Invalid_Data
MsgBox "Did not hit the ON Error test to branch"

Exit Sub

Invalid_Data:
MsgBox "Invalid SKU entered", vbCritical, "error Message"
End Sub
 
S

scuba1392

I have the error trapped and have been able to display my own desired
message; HOWEVER, I can't make the MS Access pop-up not appear after my
message.
ISn't there a way to suppress it and allow my app to continue?
 

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