Save query output to txt

D

Diogo

Hi there,

I've searched but came up empty...

Is there a way to create a query that saves the result to a txt file??

Something like:

Select * From tblsales >> sales.txt

It could save it in the same folder as the .mbd file

Thanks in advance
 
J

John W. Vinson

Hi there,

I've searched but came up empty...

Is there a way to create a query that saves the result to a txt file??

Something like:

Select * From tblsales >> sales.txt

It could save it in the same folder as the .mbd file

Thanks in advance

Save the Query (or, if you want to export the entire table skip the query).

Select the query (or table) in the database window and select File... Export.

To do this programmatically, use the TransferText method - see the VBA help
file for that keyword for details.
 
Top