Docmd output to sample

S

Stephen

Hi, all

Can anyone help me how to export reports to excel files and name them as creation date such as 05232004? I had tried Access help, but it didn't show me any sample code how to use docmd.outputto code

Please help.
 
F

fredg

Hi, all.

Can anyone help me how to export reports to excel files and name
them as creation date such as 05232004? I had tried Access help,
but it didn't show me any sample code how to use docmd.outputto
code.

Please help.

DoCmd.OutputTo acOutputReport, "ReportName", acFormatXLS,
"c:\YourFolderName\" & Format(Date, "mmddyyyy") & ".xls"

File name today would be
05232004.xls
 
A

Alp Bekisoglu

Hi Stephen,

Sorry to jump in but have a suggestion for ease of use/locating/sorting:
I would rather use "yyyymmdd" as the format. You will find it much easier
and better to locate afterwards.

Alp
 
Top