Add Date to export file Name

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"
 
K

Ken Snell

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top