Microsoft Access VBA Programming for the Absolute Beginner

Opens a query in the current database.

Syntax

DoCmd.OpenQuery QueryName[, View][, DataMode]

with the following parameters:

QueryName

A string indicating the name of the query.

View

One of the following members of the AcView enumeration: acViewDesign (design view or SQL view), acViewNormal (open in datasheet view or run an action query), or acViewPreview (print preview). The default is acViewNormal.

DataMode

For queries opened in acViewNormal view, one of the following AcOpenDataMode constants to indicate what the user can do with the query: acAdd, acEdit (the default), or acReadOnly.

Example

See the example for the CopyObject method.

Comments

Категории