次の方法で共有


DoCmd.BrowseTo Method (Access)

The BrowseTo method performs the BrowseTo action in Visual Basic.

Version Information

Version Added: Access 2010

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. You can use BrowseTo to navigate from form1 to form2 without opening up a new window.

The PathToSubFormControl argument must be specified 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

See Also

Concepts

DoCmd Object

DoCmd Object Members