npierson
05-22-2001, 12:47 PM
I am trying to prompt for a password on first run of a form. If the password is correct a certain form will load, and if not, a different form will load. I know how to prompt (stName = InputBox("Enter Password:")) and evaluate the validity of the string (or any other data type), but what function should I put this in, and what code should I use to unload the current form and load a different form?
I would really appreciate any help,
Nick
charityg
05-23-2001, 11:22 AM
Create a custom popup form for the password entry instead of using input box. Then use the openform of docmd on the enter or click of an OK command that you add to the form. Don't forget to add the close command for the password form after opening the other form.
npierson
06-04-2001, 06:03 AM
How do I create a custom pop-up password?
Thanks,
Nick
charityg
06-04-2001, 06:37 AM
Create a form with an unbound textbox and input mask of password. Set the form to popup. Place OK and Cancel command buttons on the form. In the OnClick event of the OK button use something like:
If txtPassword="YourPassword" then
docmd.openform "YourFormName"
docmd.close acform "ThisFormName"
else
docmd.openform "OtherFormName"
endif
Then in the OnClick event of the cancel button use
docmd.close acform, "ThisFormName"
[This message has been edited by charityg (edited 06-04-2001).]
npierson
06-04-2001, 07:14 AM
I can't thank you enough for all this help; however, the following line of code always receives an error: docmd.close acform "ThisFormName"
Everything else works great, but I can't seem to figure this out.
Thanks again,
Nick
npierson
06-04-2001, 11:05 AM
I used the current form (with the password) for "This Form Name" by the way.
[This message has been edited by npierson (edited 06-04-2001).]
npierson
06-05-2001, 09:45 AM
I really need to figure this out ASAP so please, if you can, help me out on this one problem.
Thanks