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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export in CSV format with DoCmd.OutputTo

Status
Not open for further replies.

djmc

Programmer
Jun 12, 2002
179
0
0
CA
I would like to know how I can export to CSV format using the DoCmd.OutputTo function in VBA. I know how to do it in .xls format but not .csv.

As well I know that when a file name is not specified in the arguments, a window will popup asking you where you would like the file to be saved in. How would I do this along with having a predefined filename in the filename box in the window when the user chooses which directory to save it in.

Thanks.
 
Take a look at the DoCmd.TransferText method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I did the following:

DoCmd.TransferText acExportDelim, , strName, strExportName, True

but it won't prompt me for where I want the file to be saved (since i specified a filename). Is there a way to get the window to pop up along with my default file name shown in the window?
 
Depending of your version of office you may consider playing with the FileDialog object before the export.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top