krishbanerjee
Programmer
pls have a look at the code below....
Private Sub Command1_Click()
On Error GoTo errtrap
For i = 0 To 2
Err.Raise 2000, "Src", "Error " & i
l1:
MsgBox i
Next i
Exit Sub
errtrap:
Err.Clear
GoTo l1
End Sub
the process requiremnt is that whenever a error ocurs we need to handle that and resume execution from the next iteration in the loop....so we can't use the "On Error Resume Next" ....so we had a structure like the above code....the problem with it is that...its trapping the error for the first time the error occurs...but when it goes for the next iteration of the loop it couldnt trap the error....help required...
Private Sub Command1_Click()
On Error GoTo errtrap
For i = 0 To 2
Err.Raise 2000, "Src", "Error " & i
l1:
MsgBox i
Next i
Exit Sub
errtrap:
Err.Clear
GoTo l1
End Sub
the process requiremnt is that whenever a error ocurs we need to handle that and resume execution from the next iteration in the loop....so we can't use the "On Error Resume Next" ....so we had a structure like the above code....the problem with it is that...its trapping the error for the first time the error occurs...but when it goes for the next iteration of the loop it couldnt trap the error....help required...