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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export SQL result to excel

Status
Not open for further replies.

emmy

MIS
Nov 7, 2000
22
US
I have a function that has 2 paramaters that are inserted into a SQL statement. I can DoCmd.OpenQuery SQL and get the correct results. However, I want to export the results to excel. I can't use DoCmd.TransferSpreadsheet or DoCmd.OutputTo because I don't have a query name. Do I need to save the sql to a querydef, run the export then kill the querydef? Is there a less cumbersome way?
 
Emmy,

I think that the querydef way is the only way to do it. I've had to do it before and found that it was the easiest method. Slightly cumbersome but not too bad.

Make things as simple as possible — but no simpler.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top