Use this type of construction for simple error handling.
On Error GoTo Err_ModuleName
' VBA statements
Exit_ModuleName:
Exit Sub
Err_ModuleName:
If Err.Number = 1234 then ' trapping for specific error, or use case stmts
' MsgBox or other statements
Else
MsgBox Err.Number & ": " & Err.Description
End if
Resume Exit_ModuleName
Then under Tools Options (in the VB window, not the Db window) you select "Break on unhandled errors" (I think this is the default).
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.