no matter what i do in my project, On Error Goto ######, On Error Resume Next, it doesnt work. I don't Understand why it wont, some of my prjects do work while others, when given an On Error statement, still error..... Any clue?
Printable View
no matter what i do in my project, On Error Goto ######, On Error Resume Next, it doesnt work. I don't Understand why it wont, some of my prjects do work while others, when given an On Error statement, still error..... Any clue?
You should post your code, errors could still appear if you don't have your errohandling set correctly
Make sure that you have your On Error Resume Next statement before the line where the Error occurs. The best place to put it would be at the top.
A little example on ignoring the error would be:
And if you were to capture it:Code:Private Sub Form_Load()
On Error Resume Next
For i = 0 to 100
Error i
Next i
'Sorry, didn't know what error to choose :p.
Exit Sub
End Sub
Hope that helps.Code:Private Sub Form_Load()
On Error GoTo ErrorTrap
For i = 0 To 100
Error i
Next i
Exit Sub
ErrorTrap:
MsgBox "Error " & Err.Number & " - " & Error$
End Sub
Maybe I am being too foolish, but Smie, just go to Project > Properties and on the General tab, see whether Break on All Errors is selected. If it is, change it to Break on Unhandled Errors.
And if you have already done it and still are having problems, listen to the Gurus instead of me!