98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » advanced micorosoft access training - VBA Access
advanced micorosoft access training - VBA Access
Resolved · Low Priority · Version Standard
Tim has attended:
Access Intermediate course
Access Advanced course
Access VBA course
VBA Access
How to trap errors
RE: VBA Access
Hi Tim
I trust that you found your Access VBA course useful. To trap errors in VBA, you need to use something known as Error handling. See below for an example:
Function MayCauseAnError()
' Enable error handler.
On Error GoTo MYError_CausesAnError
. ' Include your code here that may cause errors.
.
.
MYError_CausesAnError:
. ' code here to handle error, e.g print message to user
.
.
End Function
So in MYError_CausesAnError, you place you code that could throw up errors. In MYError_CausesAnError you handle your errors, i.e. do nothing, print a message to user, offer other options.
Hope this helps
David
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |