Home  Fees/Services  Access 2010 Template  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links
Macro Programming Examples
Open Query DoCmd
Docmd Macro VBA Example
 





DoCmd Home



OpenQuery

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.

OpenQuery
(command line continued below)
Openquery Example


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:
 

Visual Basic Select Case with OpenQuery Example

DoCmd.OpenReport stDocName, acPreview Case 2 DoCmd.OpenQuery "Q_Daily_Prospect_Labels" Case 3 Set db = CurrentDb pitney = DLookup("Path", "Q_path_Pitney",







Contact Information

Copyright 2000-2014 Blue Claw Database Design