Argument | Description |
queryname | A string expression that's the valid name of a query in the current database. |
If you execute Visual Basic code containing the OpenQuery method in a library database, Microsoft Access looks for the query with this name first in the library database, then in the current database. |
view | One of the following intrinsic constants: |
acViewDesign acViewNormal (default) acViewPreview | |
If the queryname argument is the name of a select, crosstab, union, or pass-through query whose ReturnsRecords property is set to –1, acViewNormal displays the query's result set. If the queryname argument refers to an action, data-definition, or pass-through query whose ReturnsRecords property is set to 0, acViewNormal runs the query. | |
If you leave this argument blank, the default constant (acViewNormal) is assumed. | |
datamode | One of the following intrinsic constants: |
acAdd acEdit (default) acReadOnly | |
If you leave this argument blank, the default constant (acEdit) is assumed. |
DoCmd.OpenQuery "Sales Totals Query", , acReadOnly