Parameter Property

Applies To

CommandBarButton object, CommandBarComboBox object, CommandBarControl object, CommandBarPopup object.

Description

Returns or sets a string that an application can use to execute a command associated with a command bar control. Read/write String.

Remarks

If the specified parameter is set for a built-in control, the application can modify its default behavior if it's able to parse and use the new value. If the parameter is set for custom controls, it can be used to send information to Visual Basic procedures, or it can be used to hold information about the control (similar to a second Tag property value).

Specifics (Microsoft Access)

In Microsoft Access 97, you can use the Toolbar Control Properties sheet for command bar controls to set the Parameter property 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 Parameter 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 parameter information you want in the Parameter box.

Example

This example copies the fourth control from the custom command bar named "Custom" and pastes it onto the same command bar as the new first control. The example assigns a new parameter and sets the focus to the new button.

Set myControl = CommandBars("Custom").Controls(4)
With myControl
    .Copy , 1
    .Parameter = "2"
    .SetFocus
End With