mikejaytlabustro
Access Database 2007 PH
- Local time
- Tomorrow, 06:25
- Joined
- Feb 11, 2013
- Messages
- 93
Hello access-programmers! As I moved on, vba codes seems so interesting. I have no formal education or training in microsoft access, just did self-study. And I'm so thankful that I've found and joined this site.
*** Here's my VBA code ***
Private Sub CommandButton_Click()
On Error GoTo ErrorHandler1
My codes here...
ErrorHandler1: MsgBox "Error on Procedure No. 1"
Exit Sub
On Error GoTo ErrorHandler2
My codes here...
ErrorHandler2: MsgBox "Error on Procedure No. 2"
Exit Sub
End Sub
==============================================
What I wanted to do is proceed to the Next Procedure and so on, once an error has occurred. In this code, if Procedure 1 encountered an error, it just stops there. I tried other other ways like adding Resume Next and the result, MsgBox in Errorhandler1 keeps on coming out (endlessly). Hope that I made this very clear. Thank you!
*** Here's my VBA code ***
Private Sub CommandButton_Click()
On Error GoTo ErrorHandler1
My codes here...
ErrorHandler1: MsgBox "Error on Procedure No. 1"
Exit Sub
On Error GoTo ErrorHandler2
My codes here...
ErrorHandler2: MsgBox "Error on Procedure No. 2"
Exit Sub
End Sub
==============================================
What I wanted to do is proceed to the Next Procedure and so on, once an error has occurred. In this code, if Procedure 1 encountered an error, it just stops there. I tried other other ways like adding Resume Next and the result, MsgBox in Errorhandler1 keeps on coming out (endlessly). Hope that I made this very clear. Thank you!