-3

I am exporting data from MS Access into a text file using the Write #TextFile command. Everything works OK except I need one field in the output file without the quotation marks which Write #TextFile puts around the text that is being saved.

My output file looks like the following:

"D"," 105"," ","ARCL","18/11/15","181115","DEPOSIT","99.9"
"D"," 315"," ","ARCL","18/11/15","181115","DEPOSIT","-9.9"
"D"," 315"," ","ARCL","18/11/15","181115","DEPOSIT","-90"

and I need it like this:

"D"," 105"," ","ARCL","18/11/15","181115","DEPOSIT",99.9
"D"," 315"," ","ARCL","18/11/15","181115","DEPOSIT",-9.9
"D"," 315"," ","ARCL","18/11/15","181115","DEPOSIT",-90

Any idea how to get the above format, please?

pstrjds
  • 16,840
  • 6
  • 52
  • 61

1 Answers1

2

You must use the correct data type. Strings are always enclosed in quotation marks. Convert the string to a double

Write #TextFile, someStringInQuotationMarks, CDbl(someStringContainingNumber)

E.g.: Write #TextFile, "99.9" will write "99.9" into the file, but Write #TextFile, CDbl("99.9") will write 99.9.

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188