Code Examples For RunCommand Constants

Show Query SQL

acCmdSQLView

This routine displays the SQL Design view of the query whose name is passed to it.

'***************** Code Start *******************
' Code by Terry Wickenden

Sub ShowSQL(strQuery As String)
    On Error Resume Next
    Echo False
    DoCmd.OpenQuery strQuery, acViewDesign
    DoCmd.RunCommand acCmdSQLView
    Echo True
End Sub

'****************** Code End ********************