Export to Excel Button

L

Larry G.

I need to create a button the when clicked it will export the current table
to an Excel spreadsheet. I know how to creat buttons and all, but what is the
code that will do this?
 
Y

Yanick

Put the Docmd.OutputTo function in the On_Click button Event.

Exemple : DoCmd.OutputTo (acOutputTable, "YOURTABLENAME", acFormatXLS)
 
B

balu

dear larry g .
the code docmd.outputto method do fine in xporting the qyery / table. to
say to an XLS file but sir i would like to know how to retain the format of
the xls file which will get changed on every event occurs please advise .
 
Top