Dumping Query Contents To Excel File

  • Thread starter Thread starter Craig
  • Start date Start date
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
 
you can use for example docmd.transferspreadsheet or docmd.transferdatabase

see online help for more info
 
use thbis code

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

End Sub
 
Back
Top