O'Reilly logo

Special Edition Using Access 97, Second Edition by Roger Jennings

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling Runtime Errors

No matter how thoroughly you test and debug your code, runtime errors appear eventually. Runtime errors are errors that occur when Access executes your code. Use the On Error GoTo instruction to control what happens in your application when a runtime error occurs. On Error is not a very sophisticated instruction, but it is your only choice for error processing in Access modules. You can branch to a label or ignore the error. The general syntax of On Error … follows:

						On Error GoTo
						LabelName
						On Error Resume Next
						On Error GoTo 0

On Error GoTo LabelName branches to the portion of your code with the label LabelName:. LabelName must be a label; it cannot be the name of a procedure. The code following LabelName, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required