Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Different Functionality Based on User Profile

Posted on 2006-11-06
8
Medium Priority
?
180 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.
0
Comment
Question by:vadao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17887397
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



0
 

Author Comment

by:vadao
ID: 17899596
This seems to be along the right path, although it starts to hide the controls on my form, not the menu items.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17900867
have u set the tags correctly?

how are your menu items setup, dynamically or controls that u have on the form
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:vadao
ID: 17902336
I have actually created a custom Menu Bar.  All the items on the Menu Bar are static.


0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17905563
ok, well thats different then. I thought u had meant menu items on a form
thats probably a bit more tricky, let see
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17905703
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


0
 

Author Comment

by:vadao
ID: 17907769
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.
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 total points
ID: 17908804
if using std menu bar, start with CommandBars("Menu Bar")
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question