ACCESS: Saving as comma delimited

  • Thread starter Thread starter Robin Chapple
  • Start date Start date
R

Robin Chapple

I need to export data from a membership database in CSV format for the
secretary of the organisation.

Currently my ACCESS database exports an XLS file and I convert it to
CSV in EXCEL.

Is there a way to do this in one step?

Thanks,

Robin Chapple
 
Robin,

Take a look at the TransferText method in the help file. It does just what you
need!
 
CSV is actually a Text file.

You should be able to use File / Export and select "Save As Text file" or
use code employing TransferText Method.
 
Thanks,

As you said, Just what I neded. Not ob vious to find for a beginner.

I need to export only part of the data. For the text I made an
intermediate table. Is this the correct method?

Thanks,

Robin Chapple
 
Robin,

I din't know wfat you mean by the "text" but there is no need to create an
intermediate. Just create an appropriate query that returns the data you need
and use the query as the data source for TransferText. Transfer text will then
create a text file at the path you specify. You can then attach the text file to
an email and send it to your secretary.
 
Export as a text file with extension .csv in a module...
code below changes it automatically for you...

DoCmd.TransferText acExportDelim, "Export Specs", "Data
Transfer Format", "H:\subdir\subsubdir\ExportData.txt",
False, ""
Export_Begin:

Dim oldfilename, newfilename, returnvar, testext

oldfilename = "H:\subdir\subsubdir\ExportData.txt"
newfilename = Format(Date, "mmddyy")
newfilename = "A" & newfilename & ".csv"
 
Back
Top