Dumping Query Contents To Excel File

C

Craig

I would like to know how to dump the contents of a select
query into an Excel spreadsheet (preferredly a specified
tab in the spreadsheet) using VBA code. If someone could
show me the syntax for this, I would appreciate it. Thank
you.

Craig
 
A

Alex Dybenko

you can use for example docmd.transferspreadsheet or docmd.transferdatabase

see online help for more info
 
J

jorge

use thbis code

Private Sub pasexcel(qry)
filepath = "D:\.....\" & qry2 & ".xls"
DoCmd.OutputTo acOutputQuery, qry, acFormatXLS, filepath,
False

End Sub
 

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