BrowseTo macro action

Applies to: Access 2013, Office 2013

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.

Setting

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.

Remarks

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.

Example

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]