GoToPage Macro Action

You can use the GoToPage action to move the focus in the active form to the first control on a specified page. You can use this action if you have created a form with page breaks that contains groups of related information. For example, you might have an Employees form with personal information on one page, office information on another page, and sales information on a third page. You can use the GoToPage action to move to the desired page. You can also present multiple pages of information on a single form by using tab controls.

Setting

The GoToPage action has the following arguments.

Action argument Description
Page Number The number of the page to which you want to move the focus. Enter the page number in the Page Number box in the Action Arguments section of the Macro Builder pane. If you leave this argument blank, the focus stays on the current page. You can use the Right and Down arguments to display the part of the page you want to see.
Right The horizontal position of the spot on the page, measured from the left edge of its containing window, that is to appear at the left edge of the window. This is required if you specify a Down argument.
Down The vertical position of the spot on the page, measured from the top edge of its containing window, that is to appear at the top edge of the window. This is required if you specify a Right argument.

** Note **  The Right and Down arguments are measured in inches or centimeters, depending on the regional settings in Windows Control Panel.

Remarks

You can use this action to select the first control (as defined by the form's tab order) on the specified page. Use the GoToControl action to move to a particular control on the form.

You can use the Right and Down arguments for forms with pages larger than the Microsoft Office Access 2007 window. Use the Page Number 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. Access displays the part of the page whose upper-left corner is offset the specified distance from the upper-left corner of the page.

You can't use the GoToPage action in the following cases:

  • To move the focus to a page on a hidden form.
  • To move the focus from one page to another within the tab control.

To run the GoToPage action in a Visual Basic for Applications (VBA) module, use the GoToPage method of the DoCmd object.