AddMenu Method

Microsoft Access Visual Basic

AddMenu Method

       

The AddMenu method carries out the AddMenu action in Visual Basic.

expression.AddMenu(MenuName, MenuMacroName, StatusBarText)

expression   Required. An expression that returns one of the objects in the Applies To list.

MenuName  Required Variant. 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  Required Variant. 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  Required Variant. 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.