PageIndex Property

Microsoft Access Visual Basic

PageIndex Property

       

You can use the PageIndex property to specify or determine the position of a Page object within a Pages collection. The PageIndex property specifies the order in which the pages on a tab control appear. Read/write Integer.

expression.PageIndex

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

Remarks

The PageIndex property setting is an Integer value between 0 and the Pages collection Count property setting minus 1.

You can set the PageIndex property by using a Page object's property sheet, a macro, or Visual Basic.

The PageIndex property can be set in any view.

Changing the value of the PageIndex property changes the location of a Page object in the Pages collection and visually changes the order of pages on a tab control.

You can also change the order of Page objects in the Pages collection by using the Page Order dialog box available by right-clicking the tab control in Design view and then clicking Page Order.

Example

The following example moves the page named "Notes" on the tab control named "Information" on the "Order Entry" form to the first page.

Forms("Order Entry").Controls("Information").Pages("Notes").PageIndex = 0