Caption Property (Command Bars)

Caption Property (Command Bars)

In Microsoft Access 2000, you can use the Toolbar Control Properties dialog box for command bar controls to set the caption for a control on a command bar. Display the Customize dialog box by pointing to Toolbars on the View menu and clicking Customize. For menu bar and toolbar controls, display the menu bar or toolbar, and then right-click the control whose Caption property you want to set. For shortcut menu controls, select the Shortcut Menus check box on the Toolbars tab of the Customize dialog box, then find the shortcut menu control you want on the menu bar that's displayed and right-click the control. Click the Properties command. Enter the caption you want in the Caption box.

When you display a control's Caption property setting in the Toolbar Control Properties dialog box or in Visual Basic, the ampersand (&) for the accelerator key is displayed (for example, &Paste). When you reference the control in Visual Basic, you can choose to include the ampersand (or not). For example, the following references are identical:

CommandBars("Menu Bar").Controls("Tools")
CommandBars("Menu Bar").Controls("&Tools")

When setting the Caption property, you must include the ampersand if you want the control to have an accelerator key.