Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping Data Access errors 1

Status
Not open for further replies.

EvilCabal

Programmer
Joined
Jul 11, 2002
Messages
206
Location
CA
Hi,

can I trap the errors relating to Data (Like :'The change you requested where not successful...') to make my own custom msg and handling or must I learn to live with the build-in Access error msgs?

Thanks for the help!
 
Find the error using code like this:

On error goto err_hand

Code

Error_hand
debug.print err.num
or
msgbox err.num

Once you get the number, trap it.

IIRC, duplicate entries are error 3201 and.or 3202....
Tyrone Lumley
augerinn@gte.net
 
Hi,

thanx for the quick reply but there is something i'm obviously not getting right because I get no error.

The context is this : I have a subform linked to a table and I want to trap duplicate and change access annoying message but I tried inserting error handling on most record-related event and the error never fires... Only run-time errors are trapped. What is it that I'm not doing right?
 
Ok I figured it out. You must insert the handling in the form OnError event and use DataErr and not Err.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top