Auto save date in Excel file

TallMan

Registered User.
Local time
Today, 14:03
Joined
Dec 5, 2008
Messages
239
Hey Guys,

I am trying to write code which transfers a table into an excel file and then saves it on my departments share drive with a name and date.

A file save name example would be:

TesT_File 12-6-2010.xls

I am not sure how to do this.

I have tried
PHP:
Dim dt as string 
dt = date 
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tbl_AOtmp", "S:\tallman\Test_File '" & dt & "'", True


Any ideas?
 
Try;
Code:
Dim dt as string 
dt = Format(Date, "dd-mm-yyyy") 
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tbl_AOtmp", "S:\tallman\Test_File " & dt , True
 
ah ha! Perfect! Thank you !
 

Users who are viewing this thread

Back
Top Bottom