transfer text rename output file to variable.

  • Thread starter Thread starter Clanure
  • Start date Start date
C

Clanure

Guest
I need help.

I want to use transfer text to output a tab delimited text file. I've got everything completed and can output the file accurately. My problem comes in when I try and name the file. I would like the file to be output with the following naming convention:

xxxxxxxxx_MMDDYY.txt (where xxxx represents the file name, and the MMDDYY is today's date)

I have done this before in a previous life, but cannot remember how.

Any help would be greatly appreciated.

Thanks,

Lynn
 
Hello,

This should work as a fixed export location. Just put this code on an On Click event procedure. You just need to make sure that you have created a export specification.

Dim DateText As String
DateText = Left(Date, 2) & Mid(Date, 4, 2) & Right(Date, 4)

DoCmd.TransferText acExportDelim, SpecificationName, "Table or Query Name", "C:\Documents and Settings\szymkm\Desktop\NameOfFile" & DateText & ".txt"

I hope this helps

Mark
 
That's exactly what I was looking for. Thanks for the assist.

Thanks,

Clanure
 

Users who are viewing this thread

Back
Top Bottom