Using the Body of the Code to Handle Custom Errors

The following image includes an example that uses the body of the code to handle a custom error.

Example That Handles Custom Errors In the Body of the Code. This image is described in surrounding text.

Explanation of Callouts

The example that uses the body of the code to handle a custom error includes the following items:

  1. Place the code that handles the error immediately before the line of code that could cause an error.

  2. You use the Error statement to set the custom error to a value of 30000.