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??? :sick:
Re: Nice and Easy Password field VB6
Eleanor Rigby? :D
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.
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
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