Results 1 to 4 of 4

Thread: msgbox question

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    13

    Question msgbox question

    I have this code

    While (accountsfile.Peek() > -1)
    account = accountsfile.ReadLine()
    position = InStr(account, " ")
    id = Microsoft.VisualBasic.Left(account, position - 1)
    password = Mid(account, position + 1)
    If mskAccount.ClipText = id AndAlso txtPassword.Text = password Then
    grporderform.Visible = True
    Exit While
    Else
    MsgBox("Account or Password is incorrect. Try again.")
    mskAccount.Focus()
    End If
    End While

    when executed, what it should do is check if both the id and passowrd submitted are correct, and if so, it will continue with the program. otherwise, it should show a msgbox stating that the user didn't input the right id or password.

    one of the problems with the coding i have is that when i get the id or password wrong, the msgbox will show up, and when i click it, it will show up again. this happens 4 times.
    another problem is that when i do get the right id and password. the msgbox will still show up, and i will have to click it again twice.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    While (accountsfile.Peek() > -1)
    account = accountsfile.ReadLine()
    position = InStr(account, " ")
    id = Microsoft.VisualBasic.Left(account, position - 1)
    password = Mid(account, position + 1)
    If mskAccount.ClipText = id AndAlso txtPassword.Text = password Then
    grporderform.Visible = True
    Exit While
    End If
    End While
    If grporderform.Visible = False Then
    MsgBox("Account or Password is incorrect. Try again.")
    mskAccount.Focus()
    End If


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    13
    THANK YOU! THANK YOU! THANK YOU!
    i can really use your help with other things...

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    I wish I could... I'm not that good with .Net...


    Has someone helped you? Then you can Rate their helpful post.

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