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.
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.