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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access