Add Date to export file Name

  • Thread starter Thread starter AJOLSON
  • Start date Start date
A

AJOLSON

I am exporting a query to excel file on our server, but I would like to add
whatever the current date as an extention to the Name of the file.
Example
Current export file name AA.xls
Would like it to be: aa_04/16/2010.xls

How would I code that?
Here is what I have
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "AA", _
"\\Bhihnbwfa01\groups\HR\Verification\Org_View\ AA.xls", , "AA"
 
Here is an example of how to concatenate today's date into the filename. You
can use any format that you wish, so long as it doesn't contain any
characters that are forbidden for use in a filename.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "AA", _
"\\Bhihnbwfa01\groups\HR\Verification\Org_View\ AA" & Format(Date(),
"dd-mmm-yyyy") & ".xls", , "AA"
 
Back
Top