DoCmd.TransferText + Concatenating Results (1 Viewer)

mab9

Registered User.
Local time
Today, 14:49
Joined
Oct 25, 2006
Messages
63
Hi,

I have a button that current just exports the results of a query into a text file onto the C:\. The output code I'm using now is:

Code:
DoCmd.TransferText acExportDelim, , "my_query", "C:\results\output.txt", 1

The results of this is a table that looks like:
1234
1569
1478
1524

I'm trying to alter the output slightly but not change the data in the table itself so that it looks like:
C:\results\1234.txt
C:\results\1569.txt
C:\results\1478.txt
C:\results\1524.txt

Essentially just concatinating "C:\results\" & my_query & ".txt" but I'm not sure how to begin on getting here. Any ideas?

Thanks.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:49
Joined
Aug 30, 2003
Messages
36,124
I would change the query so that it outputs the data in the format you want. In the SELECT statement it would look like your example, substituting the field name for my_query.
 

mab9

Registered User.
Local time
Today, 14:49
Joined
Oct 25, 2006
Messages
63
That dawned on me this morning, was a long day. Thanks.
 

Users who are viewing this thread

Top Bottom