Why would error trapping not be working in my app?
I'm using Access 2007. To try to track the problem down, I created a dummy form and wrote some simple code on a cmd button and forced a div by 0 error. The standard VBA msg box is displayed with run-time error 11. The Error function seems to be ignored, it doesn't catch it.
I may have caused this by changing a global setting when I was trying to get rid of a Return without GoSub error but, if I did, I don't remember what it was.
Anyone have any ideas why this isn't working?
TIA
I'm using Access 2007. To try to track the problem down, I created a dummy form and wrote some simple code on a cmd button and forced a div by 0 error. The standard VBA msg box is displayed with run-time error 11. The Error function seems to be ignored, it doesn't catch it.
Code:
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click
Debug.Print 1 / 0
Exit_cmdOK_Click:
Exit Sub
Err_cmdOK_Click:
MsgBox "Don't divide by zero"
Resume Exit_cmdOK_Click
End Sub
I may have caused this by changing a global setting when I was trying to get rid of a Return without GoSub error but, if I did, I don't remember what it was.
Anyone have any ideas why this isn't working?
TIA