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
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

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

See attached database:

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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

run the codes from the function

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
I have changed the Macro btw.
See image file:
 field name check
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
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.

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...
avoorheisAuthor Commented:
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.
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.
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.