ACC97: Changing Custom Command Bar Changes Built-In Command Bar

Last reviewed: February 2, 1998
Article ID: Q161180
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

If you create a custom command bar in Microsoft Access 97 that contains commands from the Built-in Menus category, any changes you make to the custom command bar are reflected in the built-in menus, and vice versa.

Also, if you move your database to another computer, the built-in commands on your custom command bar change to the built-in menu settings for that computer.

CAUSE

When you create a custom command bar that uses commands in the Built-in Menus category on the Commands tab of the Customize dialog box, Microsoft Access creates a pointer reference to the original built-in menu. Therefore, any modification you make to the custom command bar actually modifies the built-in menu bar.

RESOLUTION

When you create a custom command bar, do not use the Built-in Menus category on the Commands tab in the Customize dialog box. Instead, use the New Menu category, and then create your custom command bar from scratch.

The following example shows you how to add a command from the File menu to a custom command bar, and then how to modify the command without changing the built-in File menu.

  1. Open the sample database Northwind.mdb.

  2. On the View menu, point to Toolbars, and then click Customize.

  3. In the Customize dialog box, click the Toolbars tab, and then click New.

  4. In the New Toolbar dialog box, type Custom Toolbar Test in the Toolbar Name box, and then click OK. Note that an empty toolbar is displayed on the screen.

  5. Click the Commands tab in the Customize dialog box.

  6. Select New Menu in the Categories box.

  7. Drag New Menu from the Commands box to the new toolbar. Note that a New Menu item appears on the toolbar.

  8. Using the right mouse button (right-click), click New Menu on the toolbar.

  9. On the shortcut menu, type &File in the Name box, and then press ENTER.

  10. Click the File menu at the top of your screen.

  11. Hold down the CTRL key and drag the Save menu option to the File menu on the new toolbar. This copies the Save command to the new toolbar.

  12. Right-click the Save command on new toolbar.

  13. On the shortcut menu, point to Change Button Image, and then click one of the images that appears.

  14. Click Close in the Customize dialog box.

Because you used the New Menu category when you created the new command bar, the new button image you selected for the Save command does not appear on the built-in File menu.

The Microsoft Access 97 Command Bar Wizard helps you create custom command bars in Microsoft Access 97. For information on how to download this file from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q172300
   TITLE     : ACC97: Command Bar Wizard Available on MSL

MORE INFORMATION

In Microsoft Access 97, the term "command bars" refers collectively to menu bars, toolbars, and shortcut menus.

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.

  2. On the View menu, point to Toolbars, and then click Customize.

  3. In the Customize dialog box, click the Toolbars tab, and then click New.

  4. In the New Toolbar dialog box, type Change Built-In in the Toolbar Name box, and then click OK. Note that an empty toolbar is displayed on the screen.

  5. Click the Commands tab in the Customize dialog box.

  6. Select Built-in Menus in the Categories box, and then drag File from the Commands box to the new toolbar.

  7. Click File on the new toolbar, and then right-click the Save command.

  8. On the shortcut menu, point to Change Button Image, and then click one of the images that appears.

  9. Click the File menu at the top of your screen, and note that the button image for the Save command is changed there as well.

  10. Right-click the Save command on the built-in menu, and then click Reset Button Image on the shortcut menu.

  11. Click the File menu on the Change Built-In toolbar, and note that the button image is reset there as well.

  12. Click Close in the Customize dialog box.

REFERENCES

For more information about manipulating command bars in Microsoft Access 97, search the Help Index for "command bars, overview," or ask the Microsoft Access 97 Office Assistant.


Additional query words: Command bar menu-bar context secondary
commandbar
Keywords : GnlOthr UifMenub kbusage
Version : 97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Solution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.