Export to text

A

Alcsy

I am trying to export a text file but without success. The objective is to
use the sql statement below instead of using a save query to do the text
transfer. Any help appreciated and thanks in advance.

Dim strsql as string

Strsql =â€SELECT qryCountItmUsers.[Item No], Count(qryCountItmUsers.Cust) AS
CountOfCust, qryCountItmUsers.[Sman Code] FROM qryCountItmUsers GROUP BY
qryCountItmUsers.[Item No], qryCountItmUsers.[Sman Code];â€


DoCmd.TransferText acExportDelim, "", " Strsql ", "c:\RMDB\TblOrders3a.txt",
False, ""
 
K

Ken Snell \(MVP\)

TransferText will not export a query unless it's been saved.

Although the examples use TransferSpreadsheet, similar logic could be
employed with TransferText -- see my articles to see how to use tempoary
queries for such exports:

Create a Query and Export multiple "filtered" versions of a Query (based on
data in another table) to separate EXCEL files via TransferSpreadsheet
http://www.accessmvp.com/KDSnell/EXCEL_ImpExp.htm#FilterExportSepFiles


Create a Query and Export multiple "filtered" versions of a Query (based on
data in another table) to separate Worksheets within one EXCEL file via
TransferSpreadsheet
http://www.accessmvp.com/KDSnell/EXCEL_ImpExp.htm#FilterExportSameFile
 
A

Alcsy via AccessMonster.com

Thanks for the reply and the links provided more than what I expected.

Regards
TransferText will not export a query unless it's been saved.

Although the examples use TransferSpreadsheet, similar logic could be
employed with TransferText -- see my articles to see how to use tempoary
queries for such exports:

Create a Query and Export multiple "filtered" versions of a Query (based on
data in another table) to separate EXCEL files via TransferSpreadsheet
http://www.accessmvp.com/KDSnell/EXCEL_ImpExp.htm#FilterExportSepFiles

Create a Query and Export multiple "filtered" versions of a Query (based on
data in another table) to separate Worksheets within one EXCEL file via
TransferSpreadsheet
http://www.accessmvp.com/KDSnell/EXCEL_ImpExp.htm#FilterExportSameFile
I am trying to export a text file but without success. The objective is to
use the sql statement below instead of using a save query to do the text
[quoted text clipped - 10 lines]
"c:\RMDB\TblOrders3a.txt",
False, ""
 

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

Similar Threads

Export to text 1
Export to text 2
Select Text to End of Footnote 9
VBA Export to PDF 0
Schema.ini ignored - Export Text 1
Export Spec Problem 1
Schema.ini ignored - Export Text 5
Export delimited text 15

Top