I would like to insert an error trap once in a module of code to trap all errors rather than insert the trap in each sub routine. Can this be done? How?
Please advise.
Thanks,
Turbo
"There is a fine line between confidence and conceit" - Ken Mai
on error goto errHandle:
'do junk here
errHandle:
If Err.Number <> 0 Then
Call InsertError(Err.Number,Err.Description,Err.Source,"some more junk here")
else
exit sub
end if
----------------------
In a module:
----------------------
Code:
Public Sub InsertError(ErrNum as Integer, ErrDesc as String, ErrSource as string,AddtnlComments as string)
'do what you want in the code here
end sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.