Solved

How do I hide a Switchboard item?

Posted on 2008-10-07
7
228 Views
Last Modified: 2012-05-05
Dear Experts,

I have a Switchboard menu that includes an item that is restricted to system administrators only.  Users login to the application but all see the same menu.  Currently, I require a password to access this particular menu obtion - but was wondering if there is any way to hide a switchboard item.

Thanks for your help,
Jeanne
0
Comment
Question by:aeolianje
  • 5
  • 2
7 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22659156
When a user logs in, is there anything that identifies that usert as an Administrator?  

Do you have a table of users, along with some representation of their password - best if it encrypted, and not plain-text?

AW
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22659205
I once had an application with precisely the conditions that you are describing - A set of 'Administrator Only' functions, accessed via the Switchboard - and visible only to Administrators, after they had 'logged in' via a User Login on the Switchboard..  But I had a Users table, which held the User login and encrypted password, along with the functional category of the user (ADMIN, GENERAL, CLERK for example) and could then control which features were exposed (made visible) based on user Category.

AW
0
 

Author Comment

by:aeolianje
ID: 22659497
AW,

Yes - I do have a user table.  It was origianlly set up so that we could restrict certain forms.  This will be the first time we use this function - but it will be to restrict Switchboard options.

I could simply display a message based upon the user category -- but was hoping to hide the Switchboard item altogether.  Is there something that I can do when assessing the 'handlebutton'?

Thanks,
Jeanne
0
Industry Leaders: 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!

 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 250 total points
ID: 22660233
Once the user has successfully logged on, you make the various Buttons on the Switchboard Visible or Not based on the Category/Privilege of the user.

Either like this

If User.Category = "ADMIN" then
    cmdButton!.Visible = True
    cmdButton2.Visible = False
ElseIf User.Category = "GENERAL" Then
    cmdButton1.Visible = False
    cmdButton2.Visible = True
End If

or like this (your choice)

 Dim AdminVisible as Boolean
 Dim GeneralVisible as Boolean
 Dim ClerkVisible as Boolean

'only one of these can ever be true
AdminVisible = (User.Category = "ADMIN")
GeneralVisible = (User.Category = "GENERAL")
ClerkVisible = (User.Category = "CLERK")

cmdButton1.Visble = AdminVisible  'only visible to ADMIN
cmdButton2.Visble = GeneralVisible ' Only visible to General user
cmdButton3.Visble = AdminVisible OR GeneralVisible ' visible to BOTH ADMIN and GENERAL


AW
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22673348
I added a separate button, to allow the user to login, which was NOT part of the normal Switchboard - hence did not work with HandleButton.  All of the other controls/buttons on the SwitchBoard main menu were initially invisible.  Then, in the Button_Click event handler for the Login Button and based on the category of user, make the necessary buttons visible, and deal with the switchboard in the normal manner.

AW
0
 

Author Closing Comment

by:aeolianje
ID: 31504635
Thanks for your help!

This will work fine.  It does not show the Switchboard option.  It does leave a blank link but that should not be a problem for the user.

Thanks again,
Jeanne
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22679557
GLad to be of assistance.

AW
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

726 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