Adding date at the end of report name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, need urgent help on the following topic:
I'm currently using the following code to create a report. How do I add the
current date at the end of the file name for every report created? So I can
distinguis them and to prevent overwriting them?

DoCmd.OpenReport "rpt_myreport", acViewPreview, , , acHidden
DoCmd.OutputTo acOutputReport, "rpt_myreport", "SnapshotFormat(*.snp)",
"C:\Reports\rpt_myreport.snp"
DoCmd.Close acReport, "rpt_myreport", acSaveNo


I would like to generate a report like "C:\Reports\rpt_myreport18-06-2007.snp"
Thanks
 
Hi, need urgent help on the following topic:
I'm currently using the following code to create a report. How do I add the
current date at the end of the file name for every report created? So I can
distinguis them and to prevent overwriting them?

DoCmd.OpenReport "rpt_myreport", acViewPreview, , , acHidden
DoCmd.OutputTo acOutputReport, "rpt_myreport", "SnapshotFormat(*.snp)",
"C:\Reports\rpt_myreport.snp"
DoCmd.Close acReport, "rpt_myreport", acSaveNo

I would like to generate a report like "C:\Reports\rpt_myreport18-06-2007.snp"
Thanks

DoCmd.OutputTo acOutputReport, "rpt_myreport",
"SnapshotFormat(*.snp)", "C:\Reports\rpt_myreport" &
Format(Date,'mm-dd-yyyy')" & ".snp"
 
Back
Top