Output Access Query to Excel Spreadsheeet

F

Frankjl

I am exporting six queries with a DoCmd "Output To" to an excel spreadsheet.
The problem is that it creates six different spreadsheets. Is there a way to
"output" each of these queries to a different tab (i.e. work orders, purchase
orders, cost adjustments) on one spreadsheet.
 
K

Ken Snell \(MVP\)

Use the same file name for the EXCEL file in all of the exports. Just be
sure that each query has a different name.
 
F

Frankjl

Ken,

I tried this method and the second command overwrote the first spreadsheet.
Here is an example of the code I used:

DoCmd.OutputTo acOutputQuery, "100 Blanket Contract in Closed Centers Qry",
acFormatXLS, "C:\Documents and Settings\test.xls"
DoCmd.OutputTo acOutputQuery, "110 Change Order in Closed Centers Qry",
acFormatXLS, "C:\Documents and Settings\test.xls"

I would like the output of these two queries to be in one workbook with two
worksheets named such as Blanket Contract and Change Order.

Hope you can help.

Frankjl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top