Exporting a modified table to excel

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

I have created a VB backed interface at work in order to
run some SQL statements to bring me a report. I want that
report not to open in access but in excel...I can open the
report in access and everything works but I don't want it
to open in access but in excel...So far I have written
enough VB to open a spreadsheet when I run the code but I
don't know how to call the report and open it in the
spreadsheet...Do I have to call it as an object or what?
..
 
Hi,

Did you try doCmd.OutputTo acOutputReport, "YourReport", acFormatXLS, "Drive:\Path\Filename.xls", True

This will exort your report to the specified drive, directory and file and in additon start Excel with your just created file.

Try Access Help and search for 'OutputTo' for more.
 
But how do I reference the newly created table report?
-----Original Message-----
Hi,

Did you try doCmd.OutputTo acOutputReport, "YourReport",
acFormatXLS, "Drive:\Path\Filename.xls", True
This will exort your report to the specified drive,
directory and file and in additon start Excel with your
just created file.
 
Back
Top