-
I need to know how to make one text box and one command button to be able to use 3 differant passwords.
ive tried:
If Pass.Text = "pass1" Then
MsgBox "Right",,"Right"
Else
MsgBox "Wrong",,"Wrong"
End If
If Pass.Text = "pass2" Then
MsgBox "Right",,"Right"
Else
MsgBox "Wrong",,"Wrong"
End If
If Pass.Text = "pass3" Then
MsgBox "Right",,"Right"
Else
MsgBox "Wrong",,"Wrong"
this dosn't work... please help
-
Code:
If Pass.Text = "pass1" Then
MsgBox "Right", , "Right"
ElseIf Pass.Text = "pass2" Then
MsgBox "Right", , "Right"
ElseIf Pass.Text = "pass3" Then
MsgBox "Right", , "Right"
Else
MsgBox "Wrong", , "Wrong"
End If
-
what you can do :
Code:
Private Sub Command1_Click()
Dim pass As String
ok = False
For x = 1 To 3
pass = Choose(x, "password1", "password2", "password3")
If pass = pass.Text Then ok = True
Next x
End Sub
-
i'm pretty new to vb thank u for the help.