Exporting Multiple Queries to single XLS

  • Thread starter Thread starter Steve Weiss
  • Start date Start date
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
 
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!
 
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
 
Back
Top