Access 97 custom toolbars/menus

J_Orrell

Registered User.
Local time
Today, 12:43
Joined
May 17, 2004
Messages
55
Hi folks I’m a newbie here so treat me gently :)

I’m trying to build an application in Access 97 with a customized toolbar. I have created the toolbar through View/Toolbars/Customize… and the options on the various menus I have created invoke macros which in turn open up forms and/or run VB code. No problems so far.

My tool-bar is called “CashbookMenu” and has nine menus: File, Edit, Bank, Cash, Maintenance, Reports, Tools, Window, Help. When my application 'goes live' this will be the only toolbar the users see. What I want to do is disable certain options on each menu depending on the authority of the current user. The bit I’m struggling with is how to disable/enable selected options on a particular menu.

For example, I know that:

CommandBars(“CashbookMenu”).Enabled = False

disables the entire toolbar, and that:

CommandBars(“CashbookMenu”).Controls(“Maintenance”).Enabled = False

will disable just the “Maintenance” menu, but rather than disable a complete menu I want to disable just certain options on it. For example, the “Maintenance” menu has an option called “Users…”, which I don’t want people with the lowest-level of user-authority to be able to access. So you would think that something along the lines of:

CommandBars(“CashbookMenu”).Controls(“Maintenance”, “Users…”).Enabled = False

would do the trick, but it doesn’t (invalid number of arguments).

I’ve been hammering at this for two days and still can’t get a solution

Please help before I trash my laptop :mad:

Thanks
John
 
Try:

CommandBars(“CashbookMenu”).Controls(“Maintenance”).Controls(“Users…”).Enabled = False
 
Thanks for that! The reason I didn't think of that is because when I hit the full-stop after entering .Controls("Maintenance") the Controls property was never listed in the popup menu, so I assumed you couldn't use it again.

Something I've learned, then: the list of commands which pop up after you press full-stop aren't necessarily exhaustive :mad:
 

Users who are viewing this thread

Back
Top Bottom