OpenDataAccessPage Method [Access 2003 VBA Language Reference]

The OpenDataAccessPage method carries out the OpenDataAccessPage action in Visual Basic.

expression.OpenDataAccessPage(DataAccessPageName, View)

expression Required. An expression that returns one of the objects in the Applies To list.

DataAccessPageName  Required Variant. A string expression that's the valid name of a data access page in the current database. If you execute Visual Basic code containing the OpenDataAccessPage method in a library database, Microsoft Access looks for the form with this name, first in the library database, then in the current database.


AcDataAccessPageView can be one of these AcDataAccessPageView constants.
acDataAccessPageBrowsedefault Opens the form in Page view.
acDataAccessPageDesign Opens the form in Design view.


For more information on how the action and its arguments work, see the action topic.

If the connection password was not contained in the connection information for the data access page when it was created, the user is prompted to provide a password when the OpenDataAccessPage method is used.


The following example opens the Employees data access page in Design view.

DoCmd.OpenDataAccessPage "Employees", acDataAccessPageDesign

Applies to | DoCmd Object