Please Help Me about Message Box

crystaluz

Well-known member
Joined
Feb 17, 2009
Messages
55
Programming Experience
Beginner
This is my code under the btnSubmit_Click :

If (txtBox1.Text = "user") AND (txtBox2.Text = "1234") Then

MsgBox("Valid User")

Else

MsgBox("Invalid User")

End If


The problem is...if the MsgBox("Invalid User") comes out until 3 times, another Message Box will come out. How to do that?
 
You may try this

PHP:
Dim msgCount as Integer (Not in the submit SUB, dim it at the beginning of form)
 
If (txtBox1.Text = "user") AND (txtBox2.Text = "1234") Then
MsgBox("Valid User")
msgCount = 0
 
Else
MsgBox("Invalid User")
msgCount = msgCount + 1
 
End If
 
If msgCount = 3 Then
MsbBox("YOUR MESSAGE")
End If
 
You may try this

PHP:
Dim msgCount as Integer (Not in the submit SUB, dim it at the beginning of form)
 
If (txtBox1.Text = "user") AND (txtBox2.Text = "1234") Then
MsgBox("Valid User")
msgCount = 0
 
Else
MsgBox("Invalid User")
msgCount = msgCount + 1
 
End If
 
If msgCount = 3 Then
MsbBox("YOUR MESSAGE")
End If


;) ...thank you very much....
I am so slow about this :(
 
Back
Top