I am getting some weirdness with my error handling code and I am wondering if anyone can point out what I am doing wrong:
VB Code:
Private Sub Form_Load() On Error GoTo errhandler Dim x As Integer Dim i As Integer For i = 0 To 10 x = i / 0 retry: Next errhandler: MsgBox "Error" Err.Clear GoTo retry End Sub
The first time it runs we see the error message box. The second time it runs, we get the Run Time Error dialog box. Am I just missing something obvious? I tried putting another on Error Goto after the retry label, but that did not work.




Reply With Quote