EXAMINING ACCESS'S RUNTIME ERROR HANDLING

When working with Access's error handling, look at each command that can be used: On Error, Exit, and Resume.

Using the On Error Command

The On Error command lets you specify exactly where you want Access to proceed to when an error occurs. Following are the variations of the On Error command used to direct program execution.

The On Error Goto Statement

To control error handling, you must take over for the default handler by issuing the On Error Goto statement:

On Error Goto LineNumber|LineLabel
							

The On Error Goto statement has two options:

  • LineNumber can be a number placed in your routine.

Note

Although VBA lets you use line numbers to specify lines to go to, it's not good practice to do so. Goto tends ...

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.