Exporting a modified table to excel

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?
..
 
B

BerHav

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.
 
M

Matthew

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.
 

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

Top