A LAST LOOK AT ERROR-HANDLING ISSUES

The following sections cover some of the issues to watch for when creating error handlers for your routine. Watching for issues such as environment switches and knowing how to handle transactions correctly can save you from many hassles later.

Watching for Environment Switches

When setting Echo off, HourGlass on, and SetWarnings off in your routines, be sure to toggle them back to the way you want them in your error handler. These environment settings affect what happens in the application's environment. This is a good reason for using a label to exit your routine and placing these commands in the code to toggle the settings as necessary. Listing 7.18 shows an example.

Listing 7.18. VideoApp.mdb: Resetting ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.