ACC97: Only One Menu Bar Can Be Visible at a Time Using CodeLast reviewed: January 30, 1998Article ID: Q167663 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you create a new menu bar in Visual Basic for Applications code, or when you set the Visible property of an existing menu bar to True, the current menu bar disappears. However, if you create a new menu bar or view an existing menu bar by pointing to Toolbars on the View menu, and then clicking Customize, the current menu bar remains visible along with the new one. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.
RESOLUTIONYou can set the Visible property of any existing menu bar in code to make it visible, but this method only allows you to display one menu bar at a time. When you set the Visible property of any menu bar to True, Microsoft Access automatically sets the Visible property of all other menu bars to False. For example, assume your database contains two menu bars: MenuBar1 and MenuBar2. If MenuBar1 is displayed on your screen, the following line of code automatically sets the Visible property of MenuBar1 to False:
CommandBars("MenuBar2").Visible = TrueIf MenuBar2 is displayed on your screen, the following line of code automatically sets the Visible property of MenuBar2 to False:
CommandBars("MenuBar1").Visible = TrueIn order to display more than one menu bar at a time, you must create your new menu bar or view an existing one through the user interface as follows:
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor more information about menu bars, search the Help Index for "menu bars," or ask the Microsoft Access 97 Office Assistant. For more information about the Protection property of command bars, search the Help Index for "Protection property." For more information about creating command bars in code, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q159692 TITLE : ACC97: How to Create Command Bars Using Visual Basic CodeFor more information on how to programmatically add and remove items on command bars, please see the following article(s) in the Microsoft Knowledge Base:
ARTICLE-ID: Q172300 TITLE : ACC97: Command Bar Wizard Available on MSL |
Additional query words: Cmdbar menubar commandbar display show hide
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |