Form.GoToPage method (Access)

The GoToPage method moves the focus to the first control on a specified page in the active form.

Syntax

expression.GoToPage (PageNumber, Right, Down)

expression A variable that represents a Form object.

Parameters

Name Required/Optional Data type Description
PageNumber Required Long A numeric expression that's a valid page number for the active form.
Right Optional Long A numeric expression that's a valid horizontal offset (in twips) from the left side of the window to the part of the page to be viewed.
Down Optional Long A numeric expression that's a valid vertical offset (in twips) from the top of the window to the part of the page to be viewed.

Remarks

When you use this method to move to a specified page of a form, the focus is set to the first control on the page, as defined by the form's tab order. To move to a particular control on the form, use the SetFocus method.

Use the GoToPage method if you've created page breaks on a form to group related information. For example, you might have an Employees form with personal information on the first page, office information on the second page, and sales information on the third page. Use the GoToPage method to move to the desired page.

Use the Right and Down arguments for forms with pages larger than the Microsoft Access window. Use the PageNumber argument to move to the desired page, and then use the Right and Down arguments to display the part of the page that you want to see. Access displays the part of the page that's offset from the upper-left corner of the window by the distance specified in the Right and Down arguments.

Example

The following example uses the GoToPage method to move the focus to the second page of the Customer form at the position specified by the Right and Down arguments.

Forms!Customer.GoToPage 2, 1440, 600

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.