Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Access
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
AddMenu Macro Action
 

This article describes the basic operation of the AddMenu macro action. For step-by-step instructions for creating custom menus and shortcut menus, see the article Create custom menus and shortcut menus by using macros.

You can use the AddMenu action to create:

Setting

The AddMenu action has the following arguments.

Action argument Description
Menu Name The name of the menu, for example, "Report Commands" or "Tools".

To create an access key (access key: A key combination, such as ALT+F, that moves the focus to a menu, command, or control, without using the mouse.) so that you can use the keyboard to choose the menu, type an ampersand (&) before the letter you want to be the access key. This letter will be underlined in the menu name on the Add-Ins tab.

Menu Macro Name The name of the macro group (macro group: A collection of related macros that are stored together under a single macro name. The collection is often referred to simply as a macro.) that contains the macros for the menu's commands. This is a required argument.

 Note   If you run a macro containing the AddMenu action in a library database (library database: A collection of procedures and database objects that you can call from any application. In order to use the items in the library, you must first establish a reference from the current database to the library database.), Microsoft Office Access 2007 looks for the macro group with this name in the current database only.

Status Bar Text The text to display in the status bar (status bar: A horizontal bar at the bottom of the screen that displays information about the current condition of the program, such as the status of items in the window, the progress of the current task, or information about the selected item.) when the menu is selected. This argument is ignored for shortcut menus.

Remarks

To run the AddMenu action in a Visual Basic for Applications (VBA) module, use the AddMenu method of the DoCmd object. You can also set the MenuBar or ShortcutMenuBar property in VBA to create a custom menu on the Add-Ins tab or to attach a custom shortcut menu to a form, report, or control. You can set the ShortcutMenuBar property of the Application object to create a global shortcut menu.

advertisement