VBA Export with date/time stamp

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
 
D

Douglas J. Steele

DoCmd.TransferText acExportDelim, , "MyTable", "C:\Folder\MyTable_" & _
Format(Date, "yyyymmdd") & ".csv", True
 
K

kc-mass

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
 
K

kc-mass

Maybe I misunderstood. Do you just want the date/time in the name of the
CSV file??
 
A

Andy

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.
 

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