CommandBars Property

Microsoft Access Visual Basic

CommandBars Property

       

You can use the CommandBars property to return a reference to the CommandBars collection object. Read-only CommandBars object.

expression.CommandBars

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

Remarks

The CommandBars property is available only by using Visual Basic.

The CommandBars collection object is the collection of all built-in and custom command bars in an application. You can refer to individual members of the collection by using the member object's index or a string expression that is the name of the member object. The first member object in the collection has an index value of 1 and the total number of member objects in the collection is the value of the CommandBars collection's Count property.

Once you establish a reference to the CommandBars collection object, you can access all the properties and methods of the object. You can set a reference to the CommandBars collection object by clicking References on the Tools menu while in module Design view. Set a reference to the Microsoft Office 9.0 Object Library in the References dialog box by selecting the appropriate check box.