Toolbars & menus

PaulJK

Registered User.
Local time
Today, 22:13
Joined
Jul 4, 2002
Messages
60
In my db users, in addition to controls (close, minimize etc.) on forms - which are standard - users will only need have print, preview, mailto & sort buttons. Ideally, to help with security, I would like all user groups to see these only and the Adminitrator to see all toolbars & menus as standard in Access.

I have been testing this. I created a new menu selected this in the Tools Startup options & cleared the other tick boxes. When I went into my database, the new menu was shown, but I could not resurect the original toolbars. Access help suggests I should right click on the toolbar and an option would exist to restore. This does not work with me.

Am I looking at this the right way? I though this would be so simple. Should I create a new menu? Should the clear the 4 tock boxes at the botton of ToolsStartUp? How can I resurect the original toolbars & buttons?

This is only on a test db so my original is still ok.

Thanks in advance.
 
Open the DB while holding down the «SHIFT» key. This will bypass the restrictions you put in for the toolbars & menus.
 
Changing the startup options will not take effect until the next time the db is opened. Using true Access security will allow you do to what you want based on the CurrentUser funtion.

The code below will allow you to enable/disable all toolbars. You can set this up to run based on the user ID (however you define those) logged into the db.

The below code will disable (hide) all menu bars and tool bars. Ensure that you have a way to enable (unhide) the menu bars and tool bars (transparent command button) before you hide them!

'this will disable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

'this will enable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i

An added bonus is the right click option is disabled if the menu bars are disabled with this code.

HTH
 
Thanks for your replies.

Could you advise where you would place this code? I have set up a custom toolbar which I want all Groups to have apart from the Admins group. All users have a name/password combination to log in & are presented with a form serving as the switchboard.

Re the transparent command button, I have a few problems on this at the moment & trying to get a solution (may send a separate post).

Thanks in advance.
 
I have used the above code suggested by ghudson to hide the menu items/toolbars in a database I have created. I have just recently gone from using a swichboard to a custom menu. How do I use the above code but still enable my custom menu?
 
DoCmd.ShowToolbar "YourCustomToolbarNameHere", acToolbarYes

Check the help files for ShowToolbar Method for more options.

Also, you can select your custom menu in the form/report "Other" property for "Menu Bar" or "Tool Bar".

HTH
 

Users who are viewing this thread

Back
Top Bottom