Results 1 to 4 of 4

Thread: Need help with multi-password...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4

    Post

    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

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    27
    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

  3. #3
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4
    i'm pretty new to vb thank u for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width