Create Comma Quote Deliminated Txt File

  • Thread starter Thread starter Matt via AccessMonster.com
  • Start date Start date
M

Matt via AccessMonster.com

Hi -

I would like to create a comma, quote deliminated text file using VB in
Access.

Currently I am using a macro to create a deliminated text file. However each
field needs to be separated by a comma and the character strings must be
enclosed in double quotes. After the text file is created, I then have to
open the text file in editor and do a find and replace double comma's and
replace them with ,"", (comma double quote comma).

Does anyone have suggestions on how I can automate this process?

Thanks
Matt
 
Hi Matt,

The simplest thing is usually to create a query uses calculated fields
to ensure that every output field is text. Then when you export the
query using TransferText in the usual way, all the fields are
automatically qualified with quote marks.

Examples of the calculated fields you'd use:

Numeric ID field:
fID: CStr([ID])

Numeric field formatted with three decimal places:
fNum: Format([Num], "0.00")
 
Back
Top