DoCmd.BrowseTo method (Access)

The BrowseTo method performs the BrowseTo action in Visual Basic.

Syntax

expression.BrowseTo (ObjectType, ObjectName, PathtoSubformControl, WhereCondition, Page, DataMode)

expression A variable that represents a DoCmd object.

Parameters

Name Required/Optional Data type Description
ObjectType Required AcBrowseToObjectType The object type to which to browse.
ObjectName Required Variant The object that loads inside the subform control referenced by the PathtoSubformControl argument.
PathtoSubformControl Optional Variant If specified, the path from the main form of the application to the target subform control that loads the object specified by the ObjectName argument.
WhereCondition Optional Variant If specified, replaces the Where condition of the object record source.
Page Optional Variant If specified, sets the page of the continuous form that will be made the current page. This argument is web only.
DataMode Optional AcFormOpenDataMode If specified, the data entry mode of the form.

Remarks

Use the BrowseTo method to navigate between objects in place. You can also change the source object of a subform control by specifying the PathtoSubformControl argument. Use BrowseTo to navigate from Form1 to Form2 without opening up a new window.

The PathtoSubformControl argument must be specified by using the syntax in the following 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 PathtoSubformControl 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 ObjectName 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 code example opens the EventDS form in place in edit mode in the NavigationSubform subform control of the Main form.

DoCmd.BrowseTo ObjectType:=acBrowseToForm, _ 
ObjectName:="EventDS", _ 
PathToSubformControl:="Main.NavigationSubform", _ 
WhereCondition:="", _ 
Page:="", _ 
DataMode:=acFormEdit

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.