AddMenu Method

AddMenu Method

See Also                  Applies To

The AddMenu method carries out the AddMenu action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.AddMenu menuname, menumacroname, statusbartext

The AddMenu method has the following arguments.

Argument Description
menuname A string expression that's the valid name of a drop-down menu to add to the custom menu bar or global menu bar.
  To create an access key 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 menu bar.
menumacroname A string expression that's the valid name of the macro group that contains the macros for the menu's commands. This is a required argument.
statusbartext A string expression that's the text to display in the status bar when the menu is selected.

Remarks

You must include the menuname and menumacroname arguments in the AddMenu method for custom menu bars and global menu bars. The menuname argument is not required and will be ignored for custom shortcut menus and global shortcut menus.

The statusbartext argument is optional, this argument is ignored for custom shortcut menus and global shortcut menus.