DoCmd Rename Report Automatically ???

jkpats12

Registered User.
Local time
Today, 20:47
Joined
Jan 27, 2004
Messages
45
Hello,

I was wondering if there was a way to automatically rename a report being sent to a drive daily using DoCmd ?

Right now I am outputting the report to the drive fine, but it is just overwriting the previous days report, what I would like to happen for instance is todays report be sent such as: "1/27/04 Summary Report", then tomorrow's report be "1/28/04 Summary Report" and so on....

Any suggestions if this is possible would be greatly appreciated.

Thanks in advance !!!
 
You could leave the output file name out of the docmd.output command, then access will automatically ask where you want to export the file to.

Hth

Andy
 
Thank you both for your responses, but I had no luck with either of them, below is how I currently have it set up, it's working fine... going to the correct directory and all but it is just overwriting my previous report.
Ultimately what I would like to happen is that when this code runs it renames the report with the current date as the report name, as I stated above.
I tried the Format Date suggestion, but kept receiving error messages ?

If anyone could please assist me in this or if they notice something wrong in my original code I would greatly appreciate the input.

Thanks again !!


DoCmd.OpenReport "Summary_Report", acPreview

DoCmd.OutputTo _
acOutputReport, , acFormatSNP, _
"\\nel\common\Holdover_Reports\Summary_Reports\" & Summary_Report & "Summary_Report.snp"
 
Hi Pat,
Thanks for all your help.....was still having problems until I finally realized I can not rename a report with a date formatted as mm/dd/yyyy..............I had to format it as mm-dd-yyyy, and it worked perfectly.

Thanks again for your help !!
 

Users who are viewing this thread

Back
Top Bottom