export query data to text file

P

paige2005

HI All

I want to know if it is possible to run a query in access 2003 and set it up
so that the data is then exported into a text file - but each time I run
this query the file name needs to be incremented by one

example click on query to run it then exports data to file to location
c:\test\queryrun1.txt the next time I run the query the file export should
be c:\test\queryrun2.txt each time query run the number is increased by 1

Many THanks

Mick

url:http://www.ureader.com/gp/1063-1.aspx
 
T

Tom van Stiphout

On Tue, 28 Apr 2009 21:26:17 +0800,

Yes. Use DoCmd.TransferText. Somehow you need to set the FileName
argument to the next file. Perhaps you keep the last used number in a
table, read it to assemble the filename, then increment it for next
time.

-Tom.
Microsoft Access MVP
 

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