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!

HOWTO: Export multiple queries to multiple worksheets in ONE workbook 1

Status
Not open for further replies.

djpingpong

Programmer
Jul 6, 2004
70
Hi,

the subject heading pretty much explains what I need done
I created a form which allows the user to select 1 of 6 queries to export to a spreadsheet

Let's say the user selects all 6 queries to export and inputs the export filename and path... I would like "DoCmd.OutputTo acOutputQuery" to output all 6 queries into one workbook but 6 different worksheets

How can I make this possible?
 
Have a look at Transferspreadsheet. If each of the queries has a different name, it will be transferred to a different worksheet within the sames (named) workbook.

[tt]DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Query1", "Book1.xls", True[/tt]
 
hey, thanks for the quick response.. it would perfectly.. just what i was looking for... cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top