DoCmd.TransferText does not export field names correctly

  • Thread starter Thread starter JP
  • Start date Start date
J

JP

I need to export the results of a query including field names to a csv text
file. Some of the fields need a period in the caption which is illegal in
access. To get around this (as suggested by others in this newsgroup), I
changed the caption property of the field in my query to include the period.
The period displays in the column heading when I run the query in access.
However, the export does not include the period in the text file.

DoCmd.TransferText acExportDelim, "", sQry, sFile, True, ""
 
I need to export the results of a query including field names to a csv text
file. Some of the fields need a period in the caption which is illegal in
access. To get around this (as suggested by others in this newsgroup), I
changed the caption property of the field in my query to include the period.
The period displays in the column heading when I run the query in access.
However, the export does not include the period in the text file.

DoCmd.TransferText acExportDelim, "", sQry, sFile, True, ""

rats... I didin't test it and thought it might work.

You'll need to either postprocess the file or use VBA code to explicitly write
the header record, I fear!
 
Back
Top