Microsoft Access VBA Programming for the Absolute Beginner

Displays or hides a built-in or custom toolbar.

Syntax

DoCmd.ShowToolbar ToolbarName[, Show]

with the following parameters:

ToolbarName

A String specifying the name of a built-in or custom toolbar.

Show

An AcShowToolbar constant defining the toolbar’s usage. Possible values are acToolbarNo, acToolbarWhereApprop, and acToolbarYes (the default).

Example

The following code displays the Filter/Sort toolbar whenever a form is activated and hides it whenever the form is deactivated:

Private Sub Form_Activate() DoCmd.ShowToolbar "Filter/Sort", acToolbarYes End Sub Private Sub Form_Deactivate() DoCmd.ShowToolbar "Filter/Sort", acToolbarNo End Sub

Comments

Категории