VBA Export with date/time stamp

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

How can I use the 'DoCmd.TransferText acExportDelim' function to export a
table name with a date/time stamp. The table name does not have the date/time
stamp on it.

Thanks
 
DoCmd.TransferText acExportDelim, , "MyTable", "C:\Folder\MyTable_" & _
Format(Date, "yyyymmdd") & ".csv", True
 
Don't use the table directly. Instead form a query that selects all the
table fields and then add an
expression as "DateTime: Now()". Your exported data will then have the
current date/time.

Regards

Kevin
 
Yes, so I have a table 'x' and I want to output it to a location and name the
file x 2009-09-14 15:12.csv with the date/time as the export date/time.
 
Back
Top