transfertext will not include column headers when using tab delimited format

I had this issue before and just can't remember how I resolved it.
I have a very simple table and I just want to transfer it to a text file that is tab delimited and include the headers. I've tried both a macro and vba and am using a specificaiton. If I don't use the specification, the headers are transfered, but, of course, it's a coma separated file.
I made a test database and attached.

Any ideas?
thanks Test1.accdb
avoorheisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
This seems to work ... no spec

Function exporttable()
DoCmd.TransferText acExportDelim, , "TestExport", "c:\TestExport12.txt", True
End Function

mc
0
avoorheisAuthor Commented:
but it's creating a csv and not a tab delimited file?
0
danishaniCommented:
Changed the Export spec, it looks like the headers where not added in the Export spec.

See attached database:

Test1.accdb
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Rey Obrero (Capricorn1)Commented:
try this, created new export specification

run the codes from the function
Test1Rev.accdb
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
danishaniCommented:
I have changed the Macro btw.
0
danishaniCommented:
See image file:
 field name check
0
avoorheisAuthor Commented:
thanks Cap
Please tell me what you did. I can see no difference between your spec and mine except for quoting text, and, even when I change my spec for no quotes it does not show the headers. As far as I can tell, the spec has nothing to do with the headers, which should be controlled by either the "has field names" in either the macro or transfertext vba command.

For the others, here's the output I was looking for, include headers and tab delimited:
Test1      Test2      Test3
1      Hello      a
2      bye      b
0
danishaniCommented:
Did you checked the attachment I posted, change the Macro according your path, and then let me know the outcome.
Tested it, and the output is with headers, and exactly the way you described.

0
Rey Obrero (Capricorn1)Commented:
you have to check, "include field names on first row" when doing the import using the wizard for the first time.
then click the Advanced button to save the Export specification...
0
avoorheisAuthor Commented:
thanks
so, it seems if I don't use "include field names on first row" check box the first time I create a spec, I can't go back to that spec and change it or even try to update it and rename it or even delete it.
0
avoorheisAuthor Commented:
Hi dan,
I think I just look at your snapshot, which shows a csv output, which is not what I wanted and was able to get that originally. However, I just tried your example database and it does produce a tab delimited output.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.