export to csv, without double quotes

jamsta

Registered User.
Local time
Today, 15:10
Joined
Oct 29, 2009
Messages
26
Hi all,

I have this line of code:

DoCmd.TransferText acExportDelim, , "tblLetterContent", strDBPathAndFile & "\Exports\LETTERS.csv", True

This works fine. However, I wanted to export to the csv file without double quotes around each element.
So, I exported manually and created the export specification "1spec" which excludes the double quotes.
I then updated the line of code to this:

DoCmd.TransferText acExportDelim, "1spec", "tblLetterContent",
strDBPathAndFile & "\Exports\LETTERS.csv", True

Now I get an error message: "The Microsoft Access database engine could not find the object 'LETTERS#csv'.
Make sure the object exists and that you spell its name and the path name correctly."

I know what's causing this: it's because when I set up the export spec I didn't use the name "Letters.csv".
My problem is that I want to re-use this spec in a situation where the file name will change, depending on the
date of the export. Is there a way around this? Effectively what I'm asking is, is there an easy way to export to a csv
without the double quotes, in VBA? I'd be grateful for any advice.

thanks
Jamsta.
 
The name isnt the problem, I do this naming thing (with dates) on a daily basis without issues.

My (best) guess at the moment is that your 1spec is actually an import spec, try (re)creating your spec as an actual export spec and see if that helps.
 

Users who are viewing this thread

Back
Top Bottom