Date Stamp in File Name

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

Guest

Is it possible to add a date stamp to a file name automatically. I run the
same queries each morning and would like to transfer spreadsheets to the
server, but I don't want to overwrite the existing file. If I could run them
and have it add the date to the file name, this would save me a ton of time
each morning.

Any help is appreciated.
 
Dim strFile As String

strFile = "C:\MyExports\Data" & Format(Date(), "yyyymmdd") & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Employees",
strFile
 

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

Back
Top