Results 1 to 4 of 4

Thread: Nice and Easy Password field VB6

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Location
    Sunny Bournemouth UK
    Posts
    145

    Nice and Easy Password field VB6

    Hi everyone, a very simple one,
    Ive got a login screen, there is only going to be one user for the system so I need to have a field for the user name and a field for the password, at the moment ive got the code to work for the password field but can anyone advise how to add the user name, do i just add it as a another if statement???
    my code
    Code:
    private sub cmd1_click()
    if me.txtpassword = "nantwich" then
    frmwelcome.show
    
    exit sub
    end if
    ive added a second txt called txtuser, the user name is eleanor, should i just add it under the first if statement changing the variables???

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Nice and Easy Password field VB6

    Eleanor Rigby?

    Are the number of users going to grow or just stay at one or two? If it's going to grow, you should be using a database to authenticate your users. Else the IF statements should do fine as a crude approach. You could even encrypt your passwords and store them in a file and compare them.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Location
    Sunny Bournemouth UK
    Posts
    145

    Re: Nice and Easy Password field VB6

    haha.. no its just gong to stay as one user, should the code now look like this or do i need to addd something between the 2 if statements?
    VB Code:
    1. private sub cmd1_click()
    2. if me.txtpassword = "nantwich" then
    3. if me.txtuser = "eleanor" then
    4.  
    5. frmwelcome.show
    6.  
    7. exit sub
    8. end if

    Thanks
    sean

  4. #4
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Re: Nice and Easy Password field VB6

    Well, too basic use a book

    Code:
    private sub cmd1_click()
    if me.txtpassword = "nantwich" And me.txtuser = "eleanor" then
    
    frmwelcome.show
    
    exit sub
    end if

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