Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output query as a text file?

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Looking for the code to output query as a text file.
 
DoCmd.OutputTo acOutputQuery, "NameHere", acFormatTXT, "FileNameHere" Kyle

[pacman]
 
Thanks

Just further on this issue
Can I control the format of output?
Say I need certain number of spaces between the columns in the text file
 
Not with the "DoCmd.OutputTo" command. In order to do actual file manipulation you'll need to use the FileSystemObject (type that in code somewhere and hit F1 - there's way too much to go over here) Kyle

[pacman]
 
Or try checking this thread out - this'll just write the results of a recordset out to a .csv file. You can adapt it to look at the fields and format certain ones.

thread701-337260

Good luck!

The Mincefish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top