Exporting an Access Report to Excel spreadsheet(s)

greaseman

Closer to seniority!
Local time
Today, 14:17
Joined
Jan 6, 2003
Messages
360
I'm trying to export a group of four reports to an Excel spreadsheet and its workbooks, but having absolutely no luck. Does anyone have a sample piece of code that might show how to export various table fields to a spreadsheet's workbook, then switch to the second workbook to export some more fields and so on?

Thank you for your help in advance! :D
 
greaseman said:
I'm trying to export a group of four reports to an Excel spreadsheet and its workbooks

A workbook contains spreadsheets, not the opposite.

greaseman said:
...might show how to export various table fields to a spreadsheet's workbook, then switch to the second workbook to export some more fields and so on?

Do you want all of the reports in one workbook? Do you want the field names or the field values exported?

Have you ever used the Access "DoCmd.OutputTo" function?
 
Thanks for your reply. I hae four reports that I would like to place into four sheets of the spreadsheet. Also, I of course want the values of the report's respective fields to be placed into the respective sheets.

As I mentioned, I only am looking for a small snippet of code to point me in the right direction.

If you can help, it will be appreciated.
 
Code:
DoCmd.OutputTo acOutputReport, "MyReport", acFormatXLS, , True

HTH
 
Thanks for the reply... will that line of code work also even when a report has a header and footer? I tried a simple macro, using the same idea, and all that came over to Excel was the date line that I have in the header of my report.

But...I'll play around with it. :)
 

Users who are viewing this thread

Back
Top Bottom