ShowToolbar Method [Access 2003 VBA Language Reference]

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.


AcShowToolbar can be one of these AcShowToolbar constants.

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


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.


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

DoCmd.ShowToolbar "CustomToolbar", acToolbarYes

Applies to | DoCmd Object