Hide all Access Toolbars and Menubars

Status
Not open for further replies.

ghudson

Registered User.
Local time
Today, 00:43
Joined
Jun 8, 2002
Messages
6,194
The below code will hide ALL menu bars and ALL tool bars. Ensure that you have a way to unhide the menu bars and tool bars before you hide them! You should place the hide all tool bars routine in your opening splash screen form for it only needs to be run once when the db is first opened.

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

This will unhide 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 mouse button option is disabled if the menu bars are disabled with the above code.

Use the 'ShowToolbar' command if you need to display a tool bar or menu bar...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarYes

This will hide a tool bar or menu bar when needed...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarNo

This will hide the menu bar...
DoCmd.ShowToolbar "Menu Bar", acToolbarNo

You can also hide/unhide the database window with code...

Hide the database window
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

Unhide the database window
DoCmd.SelectObject acTable, , True

Remove the "Type a question for help" on the default menu bar in Access 2002 or 2003
Application.CommandBars.DisableAskAQuestionDropdown = True

This command will prevent the db from opening up a separate window tab on the Taskbar
Application.SetOption "ShowWindowsinTaskbar", False

The above commands have been successfully tested with Access 97 and Access 2003.

Read this if you do not understand where to post your questions! >>> Please Read Before Posting (http://www.access-programmers.co.uk/forums/showthread.php?t=63576)

Please do not directly PM me with any questions related to my Hide all Access Toolbars and Menubars code. Please do not post any questions related to my Hide all Access Toolbars and Menubars code in the Code Repository forum. If you have a question related to the Hide all Access Toolbars and Menubars code... Please post your questions in the appropriate forum and include a link to this thread if you have a question or problem related to my Hide all Access Toolbars and Menubars code. I will be glad to help if I see your post and if I am available.

Key words: toolbars, tool bars, menubar, menu bars, hide, unhide, enable, disable, right click, right-click, database window, hide database window,
 
Last edited:
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom