DoCmd.TransferText

D

Dylan Moran

DoCmd.TransferText acExportDelim, , "myquery", strSaveFileName

The above code I am using to export a query. The output is as follows.

"(e-mail address removed); "
"(e-mail address removed); "
"(e-mail address removed); "
"(e-mail address removed); "

etc. Note the double quotation marks are included in the output. However I
would like the ouput to be
(e-mail address removed); (e-mail address removed); (e-mail address removed);
(e-mail address removed); etc

That is, with no quotations an in or long continuous line. I have dabbled
with using the acExportFixed in DoCmd.TransferText acExportFixed, ,
"myquery", strSaveFileName

but have troubles with "not having a specification name argument" or knowing
what the heck one even is!!.

Your help with a solution is much appreciated.
 
K

Ken Snell [MVP]

You need to use an export specification where you've declared to not use "
as the text identifier. Creating an export specification is fairly easy.
From your database window, click File | Export. Begin the export process and
continue until the export wizard window opens. Then click the Advanced
button at bottom left.

In this window, set all the settings for the export process. You'll see a
box for "text identifier" which defaults to " character. Clear that out.

Click the Save As... button, give the specification a name, e.g.,
EmailExportSpec, and then save it by clicking the OK button.

Click the OK button on the window where you'd entered the settings. Cancel
the export process.

Now, in your code, where you use TransferText, put the name of the
specification (as a text string: "EmailExportSpec") as the second argument
of the call to the method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top