R
Roger Withnell
I'm using the following code to run a SELECT query:
Private Sub cmdSelectQuery_Click()
Dim strSQL As String
Dim qd As DAO.QueryDef
Dim db As DAO.Database
Set db = CurrentDb
Set qd = db.QueryDefs("Complaints Query")
strSQL = "SELECT Ingredients.Ingredient, " & txtSelectComplaint & " FROM
Ingredients"
strSQL = strSQL & " LEFT OUTER JOIN Complaints ON"
strSQL = strSQL & " (Ingredients.Ingredient = Complaints.Ingredient)"
strSQL = strSQL & " WHERE " & txtSelectComplaint & " IS NOT NULL"
strSQL = strSQL & " ORDER BY Ingredients.Ingredient"
qd.SQL = strSQL
Set qd = Nothing
Set db = Nothing
End Sub
How do I make this sub open the query window so that I can see the result,
without having to open the query window manually?
Private Sub cmdSelectQuery_Click()
Dim strSQL As String
Dim qd As DAO.QueryDef
Dim db As DAO.Database
Set db = CurrentDb
Set qd = db.QueryDefs("Complaints Query")
strSQL = "SELECT Ingredients.Ingredient, " & txtSelectComplaint & " FROM
Ingredients"
strSQL = strSQL & " LEFT OUTER JOIN Complaints ON"
strSQL = strSQL & " (Ingredients.Ingredient = Complaints.Ingredient)"
strSQL = strSQL & " WHERE " & txtSelectComplaint & " IS NOT NULL"
strSQL = strSQL & " ORDER BY Ingredients.Ingredient"
qd.SQL = strSQL
Set qd = Nothing
Set db = Nothing
End Sub
How do I make this sub open the query window so that I can see the result,
without having to open the query window manually?