OrWolf
MIS
- Mar 19, 2001
- 291
Is it possible to have an 'On Error Goto' statement that will cover all the subs in form, rather than entering it in each sub? I have a general error function that I want to call anytime an error occurs in the database, but it's going to take a lot of time and space to put the statements into each sub in each form of the database. See sample below.
Any assistance that you can provide is welcome. Thanks!
Sample:
Option Compare Database
Option Explicit
Private Sub ArchiveLocBtn_Click()
On Error GoTo ErrorHandler
Step = "AdminMenu/ArchiveLocBtn_Click"
DoCmd.Close acForm, "AdminMenu"
DoCmd.OpenForm "ArchiveLocation"
ErrorHandler:
Call GeneralError
End Sub
Private Sub FollowUpDaysBtn_Click()
On Error GoTo ErrorHandler
Step = "AdminMenu/FollowUpDaysBtn_Click"
DoCmd.Close acForm, "AdminMenu"
DoCmd.OpenForm "Criteria_DaysFromFollowUp"
ErrorHandler:
Call GeneralError
End Sub
Any assistance that you can provide is welcome. Thanks!
Sample:
Option Compare Database
Option Explicit
Private Sub ArchiveLocBtn_Click()
On Error GoTo ErrorHandler
Step = "AdminMenu/ArchiveLocBtn_Click"
DoCmd.Close acForm, "AdminMenu"
DoCmd.OpenForm "ArchiveLocation"
ErrorHandler:
Call GeneralError
End Sub
Private Sub FollowUpDaysBtn_Click()
On Error GoTo ErrorHandler
Step = "AdminMenu/FollowUpDaysBtn_Click"
DoCmd.Close acForm, "AdminMenu"
DoCmd.OpenForm "Criteria_DaysFromFollowUp"
ErrorHandler:
Call GeneralError
End Sub