J
JRF
I have an application that was handed to me and requested that I add error
handling code to all forms and modules within the application, there was
none to begin with.
Events such as below do not have any error handling.
** Event Example 1
Private Sub cmdReports_Click()
DoCmd.OpenForm "frmARDBReports", acNormal
End Sub
Though it seems like a bad practice, I would like to add common syntax to
all events, for example:
** Event Example 2
Private Sub cmdReports_Click()
On error goto err_Action
DoCmd.OpenForm "frmARDBReports", acNormal
Exit_err_Action:
Exit Sub
err_Action:
ErrorRoutine 'calls uniform error message function
Resume Exit_err_Action
End Sub
By adding the same error handling code to all events, as in Event Example 2,
will this actually create more problems than solving, with addition of the
same error handling code to all Access events within the application.
handling code to all forms and modules within the application, there was
none to begin with.
Events such as below do not have any error handling.
** Event Example 1
Private Sub cmdReports_Click()
DoCmd.OpenForm "frmARDBReports", acNormal
End Sub
Though it seems like a bad practice, I would like to add common syntax to
all events, for example:
** Event Example 2
Private Sub cmdReports_Click()
On error goto err_Action
DoCmd.OpenForm "frmARDBReports", acNormal
Exit_err_Action:
Exit Sub
err_Action:
ErrorRoutine 'calls uniform error message function
Resume Exit_err_Action
End Sub
By adding the same error handling code to all events, as in Event Example 2,
will this actually create more problems than solving, with addition of the
same error handling code to all Access events within the application.