View Full Version : Switchboard and user security


Yoshi88
03-22-2001, 09:18 PM
I created a switchboard with Access 2000, it has 3 choices a the begening. One of them is the admin utilities, but I don't want other user to see or use this item of the switchboard. Is there a way to make it invisible or disable if the user isn't the administrator of the database.

ElsVanMiert
03-23-2001, 01:23 AM
Two possibilities:
1.) the easy one: use the Currentuser:

if currentUser <>"AdminName" then
me!ButtonName.visible=false
end if

2.) the better one:
Check whether the Currentuser is part of the Administator Group (security settings should always be group-based and not user-based)

Chris RR
03-23-2001, 06:29 AM
3) You can look at the userid and compare it against a table of IDs that you maintain. This is more work, since you will probably want to set up a form just to maintain the table (so the lead user can do it). But it works great if your application requires a table with user info anyway, or if you need to get very detailed about the functions assigned to a particular user.

Also, when you make the button invisible, you might also want to disable it:
me!ButtonName.enabled=false

And, you could have the buttons set up as disabled and invisible, and only turn them on for the right user.

Yoshi88
03-23-2001, 09:22 AM
Your 2 proposition are great but i create my switchboard with the switchboard manager. If the first button is the administration choice will it affect the other menu on other function.

ex 1 is administration invisible and enable
2 choice 2
3 choice 3

if the user isn't in the admin group and choose option 2 will he get this

2.1 subchoice 2.1 invisible and enable
2.2 subchoice 2.2
2.3 cubchoice 2.3

or it will just affect the first menu