Exporting several datasets to one Excel file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have five Access files.
Let's say query1, query2, , query5 from those five Access databases.
I want to export results of quey1,..query5 to one Excel file named "Daily
Report"
How can I?

Thank you for your help
 
Use the following code in an "on click" event:


DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "QUERYNAME", _
"EXPORT LOCATION", , "SHEETNAME"

You can use this code multiple times in the same event. Change the query
name and the sheet name. The export location stays the same and it the
filepath shouldn't be too long (I've been told the maximum is 64 characters)
 

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

Back
Top