add date to file name

Johnny Drama

In need of beer...
Local time
Yesterday, 21:46
Joined
Dec 12, 2008
Messages
211
Hi all,

I'm using the following code to dump a report into an excel spreadsheet:

DoCmd.OutputTo acOutputReport, "rptPBC Query", acFormatXLS, "I:\pbcdump.xls", True

Since the report gets run multiple times I was wondering if there is a way to insert a time stamp as part fo the file name so previous files don't get overwritten.

Is this possible and if so, how?

Thanks in advance
 
I use this code to insert the datecode into the complete path\filename using the following LOC:

Code:
  'Finally arrive at the full filespec for our LogFilename
  strLogFilename = strLogDir & [B]Format(Date, "yyyymmdd")[/B] & ".JDEFandangoReplicateErrors.log"

The bold piece is where the date comes into the string.
 
works like a champ. Thanks!
 
Glad I was able to be of assistance, Johnny. Thank you for your followup post.
 

Users who are viewing this thread

Back
Top Bottom