Salvelinus' method is one of many.
If you know the SQL then you can do just.. (This is the more efficient method)
VB Code:
CurrentDb.Execute "SQL String"
or you can pull the SQL from the query and then run it..
VB Code:
CurrentDb.Execute CurrentDb.QueryDefs("Query Name").SQL
As a note always use CurrentDb.Execute in favour of DoCmd.RunSQL, especially when performing action query's as this removes the need to suppress confirmation messages generated by the DoCmd.RunSQL method, and it is more efficient.




Reply With Quote