Go Back   Access World Forums > Microsoft Access Reference > Code Repository

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 4 votes, 4.75 average. Display Modes
Old 11-22-2005, 08:59 AM   #1
ghudson
Newly Registered User
 
ghudson's Avatar
 
Join Date: Jun 2002
Location: USA
Posts: 6,199
Thanks: 1
Thanked 84 Times in 48 Posts
ghudson has a spectacular aura about ghudson has a spectacular aura about ghudson has a spectacular aura about
Hide all Access Toolbars and Menubars

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.DisableAskAQuestionDropdow n = 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/...ad.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,

__________________
.................................................. ......
Searching this forum or Microsoft.com or MSDN.com or Google is a great way to discover and learn the answers to your Access programming questions.

Well if it seems to be real, it's illusion...

I am using Access 2010 with Windows 7

The
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
function on this forum really does work.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

.................................................. ......

Last edited by ghudson; 01-24-2006 at 11:46 AM.
ghudson is offline  
The Following 6 Users Say Thank You to ghudson For This Useful Post:
brharrii (10-18-2012), dhop1990 (11-19-2013), Haakon (08-25-2013), LambtonWorm (12-07-2012), megamef (07-23-2013), vicsar (08-17-2012)
Closed Thread

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Hide all Access Toolbars and Menubars Dixie General 5 01-03-2007 09:41 AM
Toolbars and MenuBars Pauldohert General 0 08-12-2005 05:47 AM
Toolbars and Menu Bars gone crazy kcolbert01 General 2 03-03-2005 05:56 PM
Hide all Access Toolbars and Menubars grahammm General 1 02-15-2005 11:58 AM
Custom Menubars and Toolbars Vassago General 2 04-16-2003 12:04 PM




All times are GMT -8. The time now is 05:53 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World