ShowToolbar Method

Microsoft Access Visual Basic

ShowToolbar Method

       

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

expression.ShowToolbar(ToolbarName, Show)

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

ToolbarName  Required Variant. A string expression that's the valid name of a Microsoft Access built-in toolbar or a custom toolbar you've created. If you run Visual Basic code containing the ShowToolbar method in a library database, Microsoft Access looks for the toolbar with this name first in the library database, then in the current database.

Show  Optional AcShowToolbar.

AcShowToolbar can be one of these AcShowToolbar constants.
acToolbarNo
acToolbarWhereApprop
acToolbarYes default

If you leave this argument blank, the default constant (acToolbarYes) is assumed.

Remarks

For more information on how the action and its arguments work, see the action topic.

If you leave the show argument blank, don't use a comma following the toolbarname argument.

Example

The following example displays the custom toolbar named CustomToolbar in all Microsoft Access windows that become active:

DoCmd.ShowToolbar "CustomToolbar", acToolbarYes