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

Exporting to excel

Status
Not open for further replies.

commanderrico

Technical User
Jul 21, 2003
23
US
I need to export a query to Excel and I want to do it with a command button, does anyone have an example of the code to program the button. That's my first question. Second question: can I export that query to Excel and have it show up in an Excel template? I have a specific Excel format that I want to export it to and it will have to be done on a daily basis to take to my morning meetings. Can I easily make individual fields in the records reference to specific cells? Thanks for your help. Any questions let me know, Lord knows I ask enough of them.

Rico
 
Check out the docmd.outputto in access help, that should work for you.

The comand looks like this:

DoCmd.OutputTo objecttype[, objectname][, outputformat][, outputfile][, autostart][, templatefile]

And an example looks like this:

DoCmd.OutputTo acOutputReport, stReportName, acFormatXLS, "C:\reports\myreport.xls" , false

This creates the file in the reports directory of the C: drive and does not launch it.

also check out
thread705-607129


-Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top