Navigate between objects. (Access 2010)

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

   ObjectType   The object type to browse:
                acBrowseToForm (2) or acBrowseToReport (3)

   ObjectName   The object that loads inside the subform control referenced
                by the PathtoSubformControl argument.

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

                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.

   DataMode     If specified, the data entry mode of the form AcFormOpenDataMode.

BrowseTo can be used to navigate between objects in place e.g. navigate from form1 to form2 without opening a new window. You can also change the source object of a subform control by specifying PathToSubFormControl.

The PathToSubFormControl argument must include the parent form/control names as in the following example:



Opens frmSales in Add-Data mode in the "sfrNavigation" subform control on the form "frmMain".

DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmSales", _
PathToSubformControl:="frmMain.sfrNavigation", _
WhereCondition:="", _
Page:="", _

“A careful driver is one who honks his horn when he goes through a red light” ~ Henry Morgan


SetParameter - Set a parameter before opening a Form or Report.
Syntax - Form references
.NavigateTo - Display a database object in the Navigation Pane.

Copyright © 1999-2024
Some rights reserved