Exporting table contents into a .TXT file

PaulO

Registered User.
Local time
Today, 10:35
Joined
Oct 9, 2008
Messages
421
Hi

I should know how to do this, but am not seeing the wood for the trees right now so can anyone give me a pointer?

I want to output just the first field from each record in the attached DATA table into a .txt file.

The records must remain in the same order.

I created a TransferText (export delimited) macro and this kinda worked except it exported quotation marks within the text, which I don't want or need. Perhaps a bit of code behind a button would be better?

Any thoughts much appreciated.
 

Attachments

wrapping text in quotes in a delimited file is pretty standard, it prevents

this is some text, with a potential delimiter in it

being treated as two columns in a comma delimited file. Everything within the quotes is treated as a single block of text.

You can create a text export without quote qualifiers, save that as an export specification and use that specification in your transfertext command which will stop the text being wrapped in quotes

DoCmd.TransferText acExportDelim, "Export_specification", "tbl_export", "C:\temp\test.csv", vbYes
 
wrapping text in quotes in a delimited file is pretty standard, it prevents

this is some text, with a potential delimiter in it

being treated as two columns in a comma delimited file. Everything within the quotes is treated as a single block of text.

You can create a text export without quote qualifiers, save that as an export specification and use that specification in your transfertext command which will stop the text being wrapped in quotes

DoCmd.TransferText acExportDelim, "Export_specification", "tbl_export", "C:\temp\test.csv", vbYes

Thanks, I'll give that idea a whirl in the first instance
 

Users who are viewing this thread

Back
Top Bottom