Page Object [Access 2003 VBA Language Reference]

Multiple objects

A Page object corresponds to an individual page on a tab control.

Using the Page Object

A Page object is a member of a tab control's Pages collection.

To return a reference to a particular Page object in the Pages collection, use any of the following syntax forms.

Syntax Description
Pages!pagename The pagename argument is the name of the Page object.
Pages("pagename") The pagename argument is the name of the Page object.
Pages(index) The index argument is the numeric position of the object within the collection.

You can create, move, or delete Page objects and set their properties either in Visual Basic or in form Design view. To create a new Page object in Visual Basic, use the Add method of the Pages collection. To delete a Page object, use the Remove method of the Pages collection.

To create a new Page object in form Design view, right-click the tab control and then click Insert Page on the shortcut menu. You can also copy an existing page and paste it. You can set the properties of the new Page object in form Design view by using the property sheet.

Each Page object has a PageIndex property that indicates its position within the Pages collection. The Value property of the tab control is equal to the PageIndex property of the current page. You can use these properties to determine which page is currently selected after the user has switched from one page to another, or to change the order in which the pages appear in the control.

A Page object is also a type of Control object. The ControlType property constant for a Page object is acPage. Although it is a control, a Page object belongs to a Pages collection, rather than a Controls collection. A tab control's Pages collection is a special type of Controls collection.

Each Page object can also contain one or more controls. Controls on a Page object belong to that Page object's Controls collection. In order to work with a control on a Page object, you must refer to that control within the Page object's Controls collection.

Properties | Caption Property | Controls Property | ControlTipText Property | ControlType Property | Enabled Property | EventProcPrefix Property | Height Property | HelpContextId Property | InSelection Property | IsVisible Property | Left Property | Name Property | OnClick Property | OnDblClick Property | OnMouseDown Property | OnMouseMove Property | OnMouseUp Property | PageIndex Property | Picture Property | PictureData Property | PictureType Property | Properties Property | Section Property | ShortcutMenuBar Property | StatusBarText Property | Tag Property | Top Property | Visible Property | Width Property

Methods | Move Method | Requery Method | SetFocus Method | SizeToFit Method

Events | Click Event | DblClick Event | MouseDown Event | MouseMove Event | MouseUp Event

Parent Objects | Control | TabControl

Child Objects | Properties

See Also | Controls Collection | Pages Collection