Tags: access, button, database, file, item, microsoft, multiple, mysql, oracle, password, protect, sql, switchboard, tedious, users

How do I add a password to an Access switchboard item or to a file within the MD

On Database » Microsoft Access

8,073 words with 8 Comments; publish: Wed, 12 Dec 2007 10:08:00 GMT; (25062.50, « »)

Is there a way I can password protect a switchboard button/item? I don't want to set up multiple users for my database as that is a tedious process for what I need this for.

For instance:

I have 3 users that need to access everything on the switchboard, and 20 users that only need access to 3 of the 7 buttons. How do I password protect those 4/7 buttons that I don't want the 20 looking at? I need specific details and steps as I am not very good at code.

Please help! :eek:

Thank you.

All Comments

Leave a comment...

  • 8 Comments
    • Is there a way I can password protect a switchboard button/item?

      What are your buttons doing? If they open a form, you could do some code;

      (simple version) on the On Open event of your code, prompt using an input box for password, if password is right, end sub, else give error message and close form.

      (better version) have your button open a pop-up form, using a text box with password mask prompt for the password, if password is correct, open form and close password form, else give error msg and close password form and kick user back to the switchboard.

      I don't want to set up multiple users for my database as that is a tedious process for what I need this for.

      For instance:

      I have 3 users that need to access everything on the switchboard, and 20 users that only need access to 3 of the 7 buttons. How do I password protect those 4/7 buttons that I don't want the 20 looking at?

      It sure sounds like you should be considering using a User Table with fosUserName().

      I need specific details and steps as I am not very good at code.

      Let me know what you need help with. :beer:

      #1; Tue, 11 Dec 2007 21:06:00 GMT
    • Found this for you and its something that I'm going to put into my db when it's finished and working properly. It already has the code, you just need to substitute your information in (ie: command buttons, boxes, etc)

      http://www.databasedev.co.uk/button_security.html

      http://www.databasedev.co.uk/button_security.html

      #2; Tue, 11 Dec 2007 21:07:00 GMT
    • Found this for you and its something that I'm going to put into my db when it's finished and working properly. It already has the code, you just need to substitute your information in (ie: command buttons, boxes, etc)

      But that requires you to create your own switchboard with custom command buttons (which is actually a good idea, and something that I do on each of my own databases). But if you just want to use the standard Switchboard that Access provides, which I suspect kalathera is using, then you need to do one of the two methods described above.

      #3; Tue, 11 Dec 2007 21:08:00 GMT
    • Yeah, I assumed that she made her own since that what I did. I have seen the MS Access generated switchboards and just don't like 'em.

      I wonder if you can do the same in the MS Access one though? I'll have to try that and give it a whirl cause I have a security db that I imported into my current db where the developer had put in an MS Access created one. It is irritating me cause I want to change it, the MS Access switchboard, but don't know if I should cause I'm afraid it'll mess up the whole db that I'm currently doing.

      B

      #4; Tue, 11 Dec 2007 21:09:00 GMT
    • I made the switchboard using MS Access (i.e., the menu in access that allows you to create a switchboard. If someone could provide instructions on how to build a switchboard on my own that was not too difficult, I would be amenable to that as well.) My version of Access is 2000 I believe. The buttons are to open/run reports, not forms. Several of my reports have criteria prompts (date range prompts) and these are the ones that need to be protected.
      #5; Tue, 11 Dec 2007 21:10:00 GMT
    • I made the switchboard using MS Access (i.e., the menu in access that allows you to create a switchboard. If someone could provide instructions on how to build a switchboard on my own that was not too difficult, I would be amenable to that as well.) My version of Access is 2000 I believe. The buttons are to open/run reports, not forms. Several of my reports have criteria prompts (date range prompts) and these are the ones that need to be protected.

      That's really easy. You just create a new form and put command buttons on there. When you create the commmand button on the form, it'll ask you what you want to do. Then you just tell it, "Run Report", and it'll ask you which report to run. or open form, whatever. It's really easy.

      Form -> New -> Design View

      #6; Tue, 11 Dec 2007 21:11:00 GMT
    • I made the switchboard using MS Access (i.e., the menu in access that allows you to create a switchboard. If someone could provide instructions on how to build a switchboard on my own that was not too difficult, I would be amenable to that as well.)

      Usually I do a tab control on a form, but everyone's got their own way of doing it. I don't know if mine's the simplest, but it works for me and what I want to do.

      The buttons are to open/run reports, not forms. Several of my reports have criteria prompts (date range prompts) and these are the ones that need to be protected.

      If you want to keep your current switchboard, check out the attached database for how to do what I think you want. For this simplistic example, the password is password, but you can set it to whatever you want.

      You'll have to explain more how you're passing the date values to the report more if I am to help with that. Cheers.

      #7; Tue, 11 Dec 2007 21:12:00 GMT
    • I personally HATE and DETEST the switchboard (nothing better to create problems with a multi-user database over the network than using the switchboard). I've had to go through and fix a lot of other multi-user databases which utilized the switchboard and had problems. Others might have a different opinion, but for myself, I'll never use it. It may take me a bit more time, but I like to create my own buttons and menus.

      In regards to getting the loginID and setting up a password system, here's the system I use (Users don't like to remember and enter passwords so the attachment shows how you can have an admin table and compare it against the loginID). I've been using the techniques in this attachment for years now without any problems. I'm very anti-enter a password though (I've got enough passwords to remember.)

      I also like my MainForm (or MainMenu form) to be completely UNBOUND against any table - I don't recommend ever creating a MainMenu that has a recordset. You just open yourself up to problems with a networked multi-user database (keep in mind that users will most likely keep the MainMenu open for the longest time).

      You can use the example in the attachment also to create a nice menu system for yourself. But most importantly, it also shows you how to nicely design a MainformBackGround and a popup modal Mainform which essentially locks the top MSAccess menu selections (and also makes the user click the quit button verses the upper right X to exit - great for putting code in when the user quits the db). But it does also prevent them from minimizing the db (if that's important, they can do this via the Task Manager or a button can be created to minimize).

      I really like this method because I can also open the database mdb without holding the "shift" key, click close on the MainForm (which takes me to the tables/forms,etc..) and all the MSAccess tools/menus are available for development.

      Personally, I think it's a LOT (I repeat - LOT) better than disabling the shift key or password protecting the db or establishing some other elaborate password/menu system which makes it a pain to simply get in and quickly make code changes. But I'm bias because I've used this technique for so many years. (sorry Bryan - but this was kind of a pain when I made changes in your db - you may want to look at this attachment again!!)

      I can't count the number of times I got into a database and had to close and reopen with the shift key because I couldn't get to the form/table/query/report design (or MSAccess menus)!!!!!!

      !

      !

      #8; Tue, 11 Dec 2007 21:13:00 GMT