Export Queries at Run Time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that presents a number of reports for the users. Each report
has an associated query (or we can assume that anyway....) I want to present
the option of "export to Excel" for each (or at least many...) of the
reports. If I were in the interactive system, I'd do a FILE->EXPORT for the
query. How can I do this at runtime?
 
You can use the TransferSpreadsheet method to export a table or query to
Excel in code. Create a Macro that uses the TransferSpreadsheet action,
then save it as VB code. That will give you the basic form of the command.
But because it is VBA, you will be able to add parameters and error trapping
and such.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "ExportToExcel.mdb" which illustrates this.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

Back
Top