<%dim crumb crumb="OpenQuery" crumb1="Open Query DoCmd" %> OpenQuery
Home  Fees/Services  Access Templates  Tutorials  Access Download  Articles  Search  Forums  Blockchain Tech  Contact  Privacy  Links

DoCmd Examples - Access VBA<%response.write "
" & crumb1 %>

Docmd Macro VBA Example
Developer Home > Access Database Tutorials > DoCmd Examples<% response.write " > " & crumb %>
<% dim Gnum,Ynum Gnum="3847865006" Ynum="7164" dim Page_Type Page_Type="Prog" %>






DoCmd AddMenu
DoCmd ApplyFilter
DoCmd CancelEvent
DoCmd Close
DoCmd CopyObject
DoCmd DeleteObject
DoCmd FindRecord
DoCmd FindNext
DoCmd GotoControl
DoCmd HourGlass
DoCmd Min/Max/Restore
DoCmd OpenForm
DoCmd OpenQuery
DoCmd OpenReport
DoCmd OutputTo
DoCmd RunSQL
DoCmd SendObject
DoCmd TransferDatabase
DoCmd TransferText

Create Export Specs

 

Microsoft Office:
  MS Access 2003
  Access 2007
  Access 2010
  Access 2013



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",






Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013



















Contact Information

<% Response.write "Copyright 2000-" & year(now) & " Blue Claw Database Design" %>