Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run or execute query

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
I have done it ones, but looking now again how to do this.
From in your code how can you execute a make table query.
It is something with a .execute. I know how you can execute an sql.
 
Either DoCmd.RunSQL "SELECT ... INTO ... FROM ..."
or CurrentDb.Execute "SELECT ... INTO ... FROM ..."

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I added a parameter date (he gets that from a textfield from the form) to my query, its a make table query. If I run the query manually, he runs fine. If I try to do the same via my code I got the typical error message "to few parameters".
This is a real strange access problem. I think I should ask the user to run the query manually.
 
run the query manually
What about DoCmd.OpenQuery ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
or someone should show me the light in this darkness
 
To execute a parametized action query:
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter

Set db = CurrentDb
Set qdf = db.QueryDefs("NameOfQuery")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
qdf.Execute

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top