Delta34
Nov 23rd, 1999, 09:22 AM
I’ve been taking the “Visual Basic 6.0 step by step” learning addition course, and thought I would branch off on my own, and try a little code using the “If Then” statement. Using what looked like very simple code, I kept getting this annoying “End without If “ message. I finally removed the “End If” statement and the sample code ran fine. The book doesn’t seem to address when to use the “End If” statement. So consequently, I never figured out why this was happening. So here I am, a couple of weeks later, I’m trying to do a tutorial on “Visual Basic and Data Bases”, as soon as I saw the block of code with the “If Then.. End If” statement I knew I was in trouble, and sure enough I had problems.
Can anybody help me out here??
Here is the block of code from the tutorial:
Dim S as string, I as Integer
For I = 0 to 4
If txtInput(I).text = “” Then _
MsgBox “Each box must have an entry!”, vbInformation + vbOKOnly, “Error”
Exit Sub
End If
Next I
End Sub
Can anybody help me out here??
Here is the block of code from the tutorial:
Dim S as string, I as Integer
For I = 0 to 4
If txtInput(I).text = “” Then _
MsgBox “Each box must have an entry!”, vbInformation + vbOKOnly, “Error”
Exit Sub
End If
Next I
End Sub