Can I output to a file.csv

  • Thread starter Thread starter Ro477
  • Start date Start date
R

Ro477

Can I output data from a table to a file in csv format, or do I need to
output to excel then save in csv format ? I have Access 2002 with WinXP,
thanks .. Roger
 
Hi Roger,

Just choose to save as a text file [Save as type: Text Files (*.txt,
*.csv, *.tab, *.asc)] and follow the prompts for the type of text file (csv =
use comma for delimiter).

Clifford Bass
 
Thanks for reply. If I build this into a macro I can't see how I can get
that option. I have been looking at using OUTPUT TO, but is there no
text.csv option. If i use SAVE, that is all I can do, it is not "save as".
If I do it from the query window, or a report window, I can only save it,
there is no real option to save as a text file. ????

Roger

Clifford Bass said:
Hi Roger,

Just choose to save as a text file [Save as type: Text Files (*.txt,
*.csv, *.tab, *.asc)] and follow the prompts for the type of text file
(csv =
use comma for delimiter).

Clifford Bass

Ro477 said:
Can I output data from a table to a file in csv format, or do I need to
output to excel then save in csv format ? I have Access 2002 with WinXP,
thanks .. Roger
 
Hi Roger,

There is a real option to do this from VBA code or from a macro. In
either case what you want is the DoCmd.TransferText method in VBA or the
TransferText macro action, using the export delimited option. So in VBA
something like:

DoCmd.TransferText acExportDelim, , "tblGoals", "C:\Temp\Goals.csv", True

Or for a macro something like:

Action - TransferText
Transfer Type - Export Delimited
Table Name (can be a query also) - tblGoals
File Name - C:\Temp\Goals.csv
Has Field Names - Yes (or no)

The default delimiter appears to be the comma. If you want a different
delimiter, you can create an export specification and specify it. Check out
the online help for more details on the TransferText method/action and
import/export specifications.

Hope that helps,

Clifford Bass
 
Back
Top