The On Error event is a Form-level event that runs whenever an error in execution is encountered, typically within a script.
If no On Error event has been defined then a default error page will be displayed. By defining On Error event(s), you can fail gracefully and display an error message of your choosing and, if suitable, continue execution.
To add an On Error event, go to Form Properties
> Events and select the On Error tab. You can add an existing script
or create a new one
.