|
-
Apr 7th, 2005, 05:03 AM
#1
Thread Starter
Addicted Member
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???
-
Apr 7th, 2005, 05:23 AM
#2
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.
-
Apr 7th, 2005, 05:58 AM
#3
Thread Starter
Addicted Member
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:
private sub cmd1_click()
if me.txtpassword = "nantwich" then
if me.txtuser = "eleanor" then
frmwelcome.show
exit sub
end if
Thanks
sean
-
Apr 8th, 2005, 01:17 AM
#4
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|