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

Export to Text file changing Delimiter

Status
Not open for further replies.

rittiger15

Technical User
Apr 21, 2003
6
US
I am trying to export a table to a text file and am using the acExportDelim function, however I don't want a comma to be my delimiter, is there a way to change this?? Should I use different code and not use this function??

Thanks,
Chris
 
You can use TransferText, but you will need to create
an export specification and supply it as an argument
to Transfertext.

To set up the spec:

1. From the database window, click on the table you
want to export and choose File > Export.
2. Once you're in the Import/Export Wizard, check
"Delimited" and choose the delimiter you want for your
file. If it's not one of the listed ones, there's
an "other" box you can check and then enter the one you
want.
3. Let the Wizard walk you through the rest of the
process. Before the end (before you click Finish),
click "Advanced" and click "Save". Save the export
spec under whatever name you want.

To use the spec with TransferText:

DoCmd.TransferText acExportDelim, "specname", "tablename", "outputfilename"

The last 3 arguments could be variables rather than
literal strings, in which case you wouldn't need the
quotes.

 
Thanks Mikevh.

That was exactly what I needed.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top