views:

172

answers:

2

I am trying to set up error handling for a MS-Access application. The standard method to do this seems to be with an On Error statement in each subroutine/function. It seems simpler to me to use the Form_Error function to catch all the runtime errors in that form as opposed to an On Error statement for each sub/function called by an event on that form. (Obviously, for code in modules, there is no Form_Error function and therefore the only method is the On Error statement)

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

+3  A: 

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

"This includes Microsoft Access database engine errors, but not run-time errors in Visual Basic or errors from ADO."

HansUp
+2  A: 

The free MZTools utility can, with the click of a button, put in 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 more useful features such as an improved find functionality and easily locating called procedures.

Tony Toews
Thank you, thank you, thank you [repeat] [repeat]
Smandoli