How do you create multiple passwords that also go to the same form?
VB 2005
I must point out that I've never used VB 2005 and I'm not sure exactly what you're problem is, but I can tell you how I'd do it in the older versions of VB I've played with (6, I think).
When you click submit on the form where you enter the password, call a function (that you will create) which returns true or false. If True, open the form you want and if false generate an error message.
The function will take the password you enter as a parameter (or preferably a hash of it) and then search to see if it matches with passwords on some list you have. Hard-coded for a simple system? Database?
If you want to get clever and use the database you get a lot more flexibility as you can store things like form names for different passwords so a certain group of passwords can open on form, and another group open an entirely different one. This is probably getting ahead of things though.
When you click submit on the form where you enter the password, call a function (that you will create) which returns true or false. If True, open the form you want and if false generate an error message.
The function will take the password you enter as a parameter (or preferably a hash of it) and then search to see if it matches with passwords on some list you have. Hard-coded for a simple system? Database?
If you want to get clever and use the database you get a lot more flexibility as you can store things like form names for different passwords so a certain group of passwords can open on form, and another group open an entirely different one. This is probably getting ahead of things though.
I've used Visual Basic 6 aswell but the code that I've used for ceating multiple passwords is different because i want not to use data bases becuase i don't yet know how to use them, but in Visual Basic 2005 i use
IF username.text = " " And password.text = " " then
form2.show
form1.close
else
messagebox.show = retry
end IF
You see that works fine but i want to have more pass words
IF username.text = " " And password.text = " " or
username.text = " 1 " And password.text = " 1 " or
username.text = " 2" And password.text = " 2 " then ...
but it doesnt let me do that because it doesnt understand OR, but where as vb6 does and im not sure how to make sure it looks at all of them but only have to make one if statement
IF username.text = " " And password.text = " " then
form2.show
form1.close
else
messagebox.show = retry
end IF
You see that works fine but i want to have more pass words
IF username.text = " " And password.text = " " or
username.text = " 1 " And password.text = " 1 " or
username.text = " 2" And password.text = " 2 " then ...
but it doesnt let me do that because it doesnt understand OR, but where as vb6 does and im not sure how to make sure it looks at all of them but only have to make one if statement
