Exporting a Report/Query from Access to Excel

J

Jimmy

Hi,
I was looking to export data from an Access (2003) Report or Query into an
Excel worksheet or workbook. In doing this, I want to create a button that
performs this function, instead of clicking on export data or save as. The
reason for this is that I have a schedule in Access, but need to export to
other users that don't have Access but do have Excel. Any other ideas would
be appreciated.

Thanks
Jim
 
J

JackP

on the "on click" event for your button, click on the ... and choose code
builder.
add the following line.

DoCmd.TransferSpreadsheet acExport, , "My_TableOrQuery", "C:\MyFile.xls", True

note the two commas - I'm missing out a parameter here to accept the default.
Obviously change "My_TableOrQuery" and "C:\MyFile.xls" to suit.
 
J

Jimmy

Thanks Jack, very helpful.
However, when I tried to export data that included checkboxes(yes/no) fields
into Excel, they do not move over, any idea why?

Thanks
Jimmy
 

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