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

How do i set tab delimiter for csv file in A2k?

Status
Not open for further replies.

onn99

IS-IT--Management
Dec 10, 2000
24
AU
Hi all

I am currently trying to set my export table function to make a .csv file
with tab delimiter. The default is comma which i do not need. I tried
putting the specification Chr(9) for the specification name, but it said
that name is not available for access. Below is my code for my export button
click, it works already as it is but with the comma instead of the tab for
the delimiter.

Oh yeah i'm using access 2000.

strTableName = Me.lst_Export_Tables
DoCmd.TransferText acExportDelim, , strTableName, "C:\BookShop\Exported.csv"


Many thanks in advance

Xiang





 
Unfortunately the Docmd. "One-Liner" is not very flexible.

But you have VBA at your full disposal.
So you will have to write yourself a routine.
Here are the steps:
1. open recordset
2. Open an ASCII file
3. loop through the records
4. get each field you want to export
5. build a string putting a TAB in between each field > Field1 & Chr$(9) & Field2 & Chr$(9) etc
6. Write the string to a ASCII file.
7. repeat loop until all records are written
8. close recordset
9. close ASCII file


DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Thanks Doug for your help. will give a try and let u know how i go

xiang
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top