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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting .adp reports to Excel

Status
Not open for further replies.

AndrewRice

Programmer
Apr 25, 2003
2
US

I am trying to export some reports in my .adp project to Excel. I have discovered the TransferSpreadsheet method, but this does not allow SQL strings. You can only transfer Tables and Queries (which of course don't exist in .adp). I can't use a View because the datasets are user-defined (they have a form to restrict data, when the report opens it builds a SQL string based on that form and I use Me.Recordsource = strSQL) Is there a way to export these reports?
Thanks a lot.
 
Andrew,
You can use the OutputTo method as follows:

Code:
DoCmd.OutputTo acOutputReport, "yourReportName",acFormatXLS, "ExcelFilename.xls", [True/False]

If you want to automatically open the excel file set autostart to true (last argument), otherwise set it to false.

You can also specify an excel template to use. I usually leave the default.

Make sure you specify a full path for the excel output file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top