Exporting Multiple Queries to single XLS

S

Steve Weiss

Access 2000 / Excel 2000. I am using a macro to "Output to' an xls file. I
would like to output the results of multiple queries to a single workbook.
As it stands now, I can only output to individual workbooks for each query.
I don't HAVE to do this in a macro. If you have vba code that does the
trick, I'd appreciate that too!
Use the following, or whatever you have.....
qryQuery01
qryQuery02
qryQuery03
c:\queryresults.xls

Thanks!!!
Steve
 
S

Steve Weiss

I should have also made it clear that I want to be able to output each query
to it's own spreadsheet, in the single workbook. With the query name as the
tab name, if possible (like the macro output to function). If not possible,
any way to accomplish this is appreciated.
Thanks again!
 
J

John Nurick

Hi Steve,

Something like this:

Dim strWKSPath As String
Dim strQuery As String

strWSKPath = "D:\Folder\File.xls"

and then for each query

strQuery = "qry1Name"
Docmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, strQuery, _
strWKSPath, True, strQuery
 

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