We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Different Functionality Based on User Profile

vadao
vadao asked
on
Medium Priority
207 Views
Last Modified: 2012-06-27
I have an access database that has a login screen on startup which is used for a user to login to.  I currently have a user profile assigned to each user account.  I would like to drive the visible menu items to be based on what user profile the logged in user is associated with.  One example would be that the System Admin profile should have the custom Import form available while a user profile should not have the menu item visible.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2006

Commented:
A very simple and quick way (if just main menu is to be modified) is to make use of the TAG property on your main menu

Tag value - each control has a tag property. This is freetext.

What u can do is write down one or more different profile names here

e.g.
Import Menu control - tag property includes "system"
View Menu control - tag property includes "system" and "user"

etc

Now when user logs on, u know the profile they are logged into, u can then go thru the controls and hide/unhide

dim ctl as control

for each ctl in me.controls
    if instr(1,ctl.tag,sMyProfile) > 0 then ctl.visible=true else ctl.visible=false
next ctl

where sMyProfile is the profile u are logged into



Author

Commented:
This seems to be along the right path, although it starts to hide the controls on my form, not the menu items.
CERTIFIED EXPERT
Top Expert 2006

Commented:
have u set the tags correctly?

how are your menu items setup, dynamically or controls that u have on the form

Author

Commented:
I have actually created a custom Menu Bar.  All the items on the Menu Bar are static.


CERTIFIED EXPERT
Top Expert 2006

Commented:
ok, well thats different then. I thought u had meant menu items on a form
thats probably a bit more tricky, let see
CERTIFIED EXPERT
Top Expert 2006

Commented:
Ok, u can use CommandBars to do it

Say your menu bar was called

Fred

and in here u had sub menus, Fred2 and Fred3

so group your options into submenus, this way u just hide the group

CommandBars("Fred").Controls("Fred2").Visible = False
CommandBars("Fred").Controls("Fred3").Visible = True


Author

Commented:
Lokls like that did the trick.  I am having an issue when trying to reference menu item in a sub menu, So I will be playing around with that a bit more.  ie File|Import.
CERTIFIED EXPERT
Top Expert 2006
Commented:
if using std menu bar, start with CommandBars("Menu Bar")

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.