MS-Access VBA: form_error vs on error

I am trying to configure error handling for an MS-Access application. The standard method for this seems to be associated with the On Error statement in each routine / function. It seems to me that it is easier to use the Form_Error function to catch all the runtime errors in this form, rather than the On Error operator for each subfunction called by an event in this form. (Obviously, there is no Form_Error function for the code in the modules, and therefore the On Error operator is the only method)

What are the pros and cons of using On Error vs Form_Error?

+4
source share
2 answers

The Form.Error event is limited. From Access Help:

"This includes Microsoft Access database kernel errors, but not runtime errors in Visual Basic or errors from ADO."

+3
source

The free MZTools utility can, by clicking a button, place the error handling code in each event procedure for you. You can also easily customize the code for your own preferences. The utility also has many useful features, such as improved search functionality and the convenience of finding called procedures.

+2
source

Source: https://habr.com/ru/post/1304194/


All Articles