OpenQuery Method Example
The following example opens Sales Totals Query in Datasheet view and enables the user to view but not to edit or add records:
DoCmd.OpenQuery "Sales Totals Query", , acReadOnly