I have the following code in a form with a command button on the form. If I run this code It does what I'm wanting it to do.. i.e loops through the sub 5 times. After the 5th time the if statement is false so i was thinking it should simply msgbox the error and exit the sub. However it loops round the msgbox for a few times then exits the sub?
Can anyone explain whats happening?
Public errortimes As Integer
Private Sub Command1_Click()
On Error GoTo Err
Dim i As Integer
i = "t"
Err:
errortimes = errortimes + 1
If errortimes < 6 Then
Call Command1_Click
End If
MsgBox Err.Description
End Sub
Can anyone explain whats happening?
Public errortimes As Integer
Private Sub Command1_Click()
On Error GoTo Err
Dim i As Integer
i = "t"
Err:
errortimes = errortimes + 1
If errortimes < 6 Then
Call Command1_Click
End If
MsgBox Err.Description
End Sub