다음을 통해 공유


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.

You can 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. You can use the GoToPage method to move to the desired page.

You can 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 you want to see. Microsoft 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

See Also

Concepts

Form Object

Form Object Members