Launching a txt file in VBA

BenJones

BenJones
Local time
Today, 02:09
Joined
May 19, 2004
Messages
10
I have a Access 97 database which transfers data in a specified format to a txt file. I want to provide a button on an access switchboard which can launch the txt file for the user to see the data they have just transferred.

Can anybody provide me with a line of VBA code which will do this.

Many Thanks
 
try this:

DoCmd.OutputTo acOutputQuery, "QueryToSend", acFormatTXT, "PathforFile" , True


replace "QueryToSend" with the name of your query and/or table (in case it is a table, replace acOutputQuery to acOutputTable), and replace the PathforFile with the path of your textfile (e.g. "C:\Documents and Settings\user\Desktop\test.txt")
 
Thanks

That did the trick
 

Users who are viewing this thread

Back
Top Bottom