I'm probably missing something really simple here. I want to create a new Query and open that in Design mode with a source table/query already chosen, but no fields yet added to the query. The wizards do something similar to this, but I can't figure it out how to create the query without selecting any fields.
-------------------
Rob Foye
Database Management
Regions Bank
Code:
Sub sOpenQryDesign()
Dim stQuery As String
'Replace with msgbox to prompt for name
stQuery = "RF-test"
sCreateNewQuery stQuery
DoCmd.OpenQuery (stQuery), acViewDesign
End Sub
Sub sCreateNewQuery(stQname As String)
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Const stSQL As String = "SELECT * FROM qry1;"
Set db = CurrentDb
Set qdf = db.CreateQueryDef(stQname, stSQL)
qdf.Close
Set db = Nothing
End Sub
-------------------
Rob Foye
Database Management
Regions Bank