Export Access Query to Excel Preformatted?

  • Thread starter Thread starter Rubix
  • Start date Start date
R

Rubix

Does Access have this capability, and if not, I would just like some code and
where to place it to do this.
I would also like code taht I could connect someway to this button that
formats the spreadsheet (macro?).
I'm not good with VBA (especially the syntax) so if anyone could put if
lamen's terms: writing when I would need to enter my qry name and where this
code would go (in the button, event property, etc).

ANY help is much appreciated!!
 
You can export an Access table or query to an Excel spreadsheet (.xls.)
Place this code in the On click property of the button:
DoCmd.OutputTo acQuery, "Query", "MicrosoftExcelBiff8(*.xls)", "Path",
True, "", 0
Substitute the name of your query for Query and the full path and name of the
new Excel for Path. Leave the quotes. You can cahnge the True to False if
you don't want to open this new spreadsheet automatically once it is exported.
 
Back
Top