Error Event

Microsoft Access Visual Basic

Error Event

       

The Error event occurs when a run-time error is produced in Microsoft Access when a form or report has the focus.

Remarks

This includes Microsoft Jet database engine errors, but not run-time errors in Visual Basic.

To run a macro or event procedure when this event occurs, set the OnError property to the name of the macro or to [Event Procedure].

By running an event procedure or a macro when an Error event occurs, you can intercept a Microsoft Access error message and display a custom message that conveys a more specific meaning for your application.