Link to home
Start Free TrialLog in
Avatar of geeta_m9
geeta_m9

asked on

Password Protecting a Menu Option in MS-Access 2010

I have a switchboard menu (see attached, Main Menu.jpg). What I would like to do is to make the second option in the menu, i.e., Graduation Application, password protected, so that if a user clicks on the option, a prompt will appear asking him/her to enter the password. If the user enters the password successfully, then they will be allowed to continue (in this case, they will proceed to the "View, Edit, Import Records or Print Applications" menu (see Switchboard Items.jpg). If they fail to enter the correct password, they will remain at the same menu. I have also attached the code for the SwitchBoard (SwitchBoard_Code1.jpg and SwitchBoard_Code2.jpg).

What would be the easiest way to go about this? Should I use a form or an inputbox?

Thanks.
Main-Menu.jpg
Switchboard-Items.jpg
SwitchBoard-Code1.jpg
SwitchBoard-Code2.jpg
Avatar of Eric Sherman
Eric Sherman
Flag of United States of America image

I have a Access application where I created that functionality using a password prompt form.  I will review your samples and respond shortly.

ET
Avatar of geeta_m9
geeta_m9

ASKER

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Eric Sherman
Eric Sherman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My situation is a little different because of the switchboard. I am not sure where to put the VBA code.

I am attaching a copy of the database.
GraduationApplication-August2012.accdb
<<<<<My situation is a little different because of the switchboard. I am not sure where to put the VBA code.>>>>>

Yes, and I've looked at your db ... you are using embedded macros and my solution assumed you were using VBA events.  Although it probably works for you, the macros seems a bit confusing for me to navigate and follow.  I would have just used Combo Boxes on the main form to present the user with various selections.  Then using the After Update Event, either Enable or Disable the relative selection box.

Maybe another Expert who works with embedded macros can provide something that will work with what you already have.

ET
I tried the code that you gave, and it works well. The only problem I am facing now is that I am unable to go down to the next level of the menu if the user enters the password correctly... it is still stuck at the same menu level. The switchboard menu was created using macros, and I don't know how to write the code (or  the macro) to make it go down to the next level of the menu.

It looks as though I may have to redesign my menu to use the code builder (VBA) instead of macros, if I want to make the option password protected.

Anyway, I appreciate your help.
Thanks for the points ...  I would use Combo Box Controls and Forms Objects to present the user with a menu selection.  If the password is entered correctly, you can either open the Form or Enable a Control, etc.

ET