OpenQuery Method Example
The OpenQuery method opens a select or crosstab query in Datasheet view, Design view, or Print
Preview - or runs an action query from visual basic.

(command line continued below)

The QueryName is the only required argument in the openquery
statement and is the name of a saved
query definition.
View - is the view mode and can have one of the following values:
acViewDesign
acViewNormal (default viewmode)
acViewPivotChart
acViewPivotTable
acViewPreview
DataMode - which has the following options:
acAdd
acEdit default
acReadOnly
When running an action OpenQuery you normally only specify the name of the query:
DoCmd.OpenQuery "Q_Update_Due_Date"
More OpenQuery examples:
| DoCmd.OpenReport stDocName, acPreview
Case 2 DoCmd.OpenQuery "Q_Daily_Prospect_Labels" Case 3 Set db
= CurrentDb pitney = DLookup("Path", "Q_path_Pitney", |