troubleshooting Question

VBA Access Errohandler In Modules When Calling Other Modules

Avatar of Dustin Stanley
Dustin Stanley asked on
Microsoft AccessVBA
6 Comments4 Solutions88 ViewsLast Modified:
Let's say I have multiple modules for my code Module_1, Module_2, and Module_3.

**THIS IS JUST QUICK IN A HURRY SAMPLE BUT GIVES THE IDEA**
If in each Module at the beginning it say If error Goto Errorhandler:
Public Sub Module_1 ()
On error Goto Errorhandler
 Call Module_2
Exit Sub
Errorhandler:
 Yadda Yadda
Exit Sub

Public Sub Module_2 ()
On error Goto Errorhandler
If "" & Value1 = "" Then
 Call Module_3
End If
Exit Sub
Errorhandler:
 Yadda Yadda
Exit Sub

Public Sub Module_3 ()
On error Goto Errorhandler
 'Do Something Here
If Me.Dirty Then
Else
Exit Sub
Errorhandler:
 Yadda Yadda
Exit Sub

Then if there is an error in Module_1 or Module_2....
Which Module will the error handler come from?

This is just a little confusing and I am trouble shooting some modules.
Thanks for the help.
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Database Architect / Application Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2007

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 4 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros