Thursday, June 2, 2022

Gotopage macro action

You can use the GoToPage macro action in Access desktop databases 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 macro action to move to the desired page. You can also present multiple pages of information on a single form by using tab controls.

Note: The GoToPage macro action isn't available in Access web apps.

Setting

The GoToPage macro 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. This argument is a required argument. 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.

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.

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 macro action to select the first control (as defined by the form's tab order) on the specified page. Use the GoToControl macro 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 Access 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 macro 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 macro action in a Visual Basic for Applications (VBA) module, use the GoToPage method of the DoCmd object.

No comments:

Post a Comment