Date Stamp in File Name

M

mcgregor

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.
 
D

Douglas J. Steele

Dim strFile As String

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