BrowseTo Macro Action

Office 2013 and later

Last modified: July 28, 2015

Applies to: Access 2013 | Office 2013

In this article
Setting
Remarks
Example
About the Contributors

You can use the BrowseTo action to navigate between objects in place. You can also change the source object of a subform control by specifying the Path to Subform Control argument. Use BrowseTo to navigate from form1 to form2 without opening up a new window.

The BrowseTo action has the following argument.

Action argument

Description

Object Type

The object type to which to browse.

Object Name

The object that loads inside the subform control referenced by the Path to Subform Control argument.

Path to Subform Control

If specified, the path from the main form of the application to the target subform control that loads the object specified by the Object Name argument.

Where Condition

If specified, replaces the Where condition of the object record source.

Page

If specified, sets the page of the continuous form that will be made the current page. This argument is Web only.

Data Mode

If specified, the data entry mode of the form.

The PathToSubFormControl argument must be specified using the syntax in the following code example:

Main Form.SubForm Ctrl 1>Form 2.SubForm Ctrl 2>Form 3.SubFormCtrl3

In this example, the Main Form is the top level form in the Access client application. The Path to Sub Form Control argument must alternately specify form and subform control names leading from the main form to the subform control that is the container of the object specified by the Object Name argument. Each subform control specified must be a control on the form that precedes it. The path must end with a subform control.

The following example shows how to use the BrowseTo action to open a report in a subform control or within a navigation control.

Sample code provided by: The Microsoft Access 2010 Programmer’s Reference

OnError
    Go to Next
    Macro Name

/* Try to load the report in the host form (frmAuthorsParameter)    */
BrowseTo
    Object Type Report
    Object Name rptChapters
    Path to Subform Control frmAuthorsParameter.sfrmChild
    Where Condition
    Page
    Data Mode Edit

Parameters
    SelectedAuthor =[cboAuthor]

/* if this fails, try to load it in the navigation subform     */
BrowseTo
    Object Type Report
    Object Name rptChapters
    Path to Subform Control frmMain.NavigationSubform>frmAuthorsParameter.sfrmChild
    Where Condition
    Page
    Data Mode Edit

Parameters
    SelectedAuthor =[cboAuthor]

Wrox Press is driven by the Programmer to Programmer philosophy. Wrox books are written by programmers for programmers, and the Wrox brand means authoritative solutions to real-world programming problems.

Show: