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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the TransferText Command

Status
Not open for further replies.

Stangleboy

Programmer
May 6, 2002
76
US
I have been searching posts and FAQ but have not found any solution to an issue I have using the TransferText command in VBA. My code works but the resulting text file I produce has qoutes ("") at the beginning and end of each record. Can I strip or delete the quotes in VBA code prior to it creating the text file? Or maybe I should be looking at another process? Thank you in advance on your time on this inquiry.

Code Example:
Private Sub bttn_EmailList_Click()

DoCmd.TransferText acExportDelim, , "qry_EmailList", "C:Test.txt"

End Sub
 
Use a SpecificationName

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am not familiar where to use that, is that in the original code or a new line in the code? thank you!
 
Do the export manually saving the specifications.
Then use it as the 2nd parameter of the TransferText method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
So in the direction above using the SpecificationName; I would have to change my query to a "Make Table" to make a temporary table then run the "Export" wizard from the temp table and save the wizard. Then use the code above pointing to the name I gave the wizard and add more code to delete the temp table at the end so the next fresh table can be ran for the next user. And this will get rid of the quotes around each record in my exported text file? Thanx!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top