Reset Method
Applies To
CommandBar object, CommandBarButton object, CommandBarComboBox object, CommandBarControl object, CommandBarPopup object.
Description
Resets the specified built-in command bar to its default configuration of controls, or resets the specified built-in command bar control to its default function and face.
Syntax
expression.Reset
expression Required. An expression that returns a CommandBar, CommandBarControl, CommandBarButton, CommandBarPopup, or CommandBarComboBox object.
Remarks
Resetting a built-in control restores the actions originally intended for the control and resets each of the control's properties back to its original state. Resetting a built-in command bar removes custom controls and restores built-in controls.
See Also
ResetTips method.
Specifics (Microsoft Access)
In Microsoft Access 97, you can use the Toolbar Properties sheet to reset a built-in menu bar or toolbar. Point to Toolbars on the View menu and click Customize, then click the Properties button in the Customize dialog box. Select the built-in menu bar or toolbar you want in the Selected Toolbar box, and then click the Restore Defaults button. You can't reset a custom menu bar or toolbar, or a specific shortcut menu.
The Reset button in the Customize dialog box resets the selected built-in menu bar or toolbar, or all built-in shortcut menus if you select Shortcut Menus in the Customize dialog box. The Reset command on the shortcut menu that's displayed when you right-click a particular built-in control on a menu bar or toolbar while the Customize dialog box is open resets that control to its original state. The Reset button and Reset command are equivalent to the Reset method.
The Restore Defaults button not only resets the menu bar or toolbar controls' image, text, and the commands they run, but also restores all of the original settings for the menu bar or toolbar, including its original position and visibility.
Example
This example uses the value of user to adjust the command bars according to the user level. If user is "Level 1," the command bar named "Custom" is displayed. If user is any other value, the built-in Visual Basic command bar is reset to its default state and the command bar named "Custom" is disabled.
Set myBar = CommandBars("Custom")
If user = "Level 1" Then
myBar.Visible = True
Else
.CommandBars("Visual Basic").Reset
myBar.Enabled = False
End If