Open a query.

      DoCmd.OpenQuery(QueryName, View, DataMode)

   QueryName      The name of the query to open.

   View           An AcView constant that specifies the view
                  in which the query will open. Default=acViewNormal

   DataMode       An AcOpenDataMode constant that specifies the
                  data entry mode for the query.
                  The default value is acEdit.

Use OpenQuery to open a select or crosstab query in Datasheet view, Design view, or Print Preview.
This action will run an action query.


Open qryDemo and enable the user to view but not to edit or add records:
DoCmd.OpenQuery "qryDemo", , acReadOnly

“I get all the news I need from the weather report” ~ Paul Simon


OpenReport - Open a report
OpenForm - Open a form.

Copyright © 1999-2024
Some rights reserved