×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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





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

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.

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

(OP)
Thanks Doug for your help. will give a try and let u know how i go

xiang

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close