Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer Text option 1

Status
Not open for further replies.

Crauck

Programmer
Jul 26, 2002
24
US
I need to be able to use a period in my file name. I am getting my file name by using a field in my database. For some reason when I use TransferText (because I need it in Comma Delimited) it changes my period to a pound sign. Here is the code I am using, any help would be appreciated.

Private Sub Form_Close()

Dim Mycode As String


Mycode = Code

DoCmd.TransferText acExportDelim, "Evcor", "Evcor", ("c:\Working\" & Mycode & ".csv"), True

End Sub
 
DoCmd.TransferText acExportDelim, "Evcor", "Evcor", ("c:\Working\Temp.csv"), True

Name "c:\Working\Temp.csv" as "c:\Working\" & MyCode & ".csv"




if that doesn't work maybe you can write a quick loop to change dots to underscores.
 
That is amazing, It seem to have worked. Could you explain, possibly, why it had to work that way.

I have been trying so many different things for 2 days now. Thank you soo much.
 
It's kinda hard to explain, it just popped in my head. I guess I was assuming that the TransferText function was cooking the file name (adding the #'s), while the more 'basic' (no pun intended) Name function pretty much passed the parameters straight to the Operating System for renaming.
 
Thanks again, it seems to be working perfect.
 
No problem.

FYI, you may want to put in all kinds of error handling at this point. Also make sure that temp.csv doesn't already exist.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top