avoorheis
asked on
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
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
ASKER
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:
Test1.accdb
See attached database:
Test1.accdb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have changed the Macro btw.
ASKER
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
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.
Tested it, and the output is with headers, and exactly the way you described.
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...
then click the Advanced button to save the Export specification...
ASKER
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.
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.
ASKER
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.
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.
Function exporttable()
DoCmd.TransferText acExportDelim, , "TestExport", "c:\TestExport12.txt", True
End Function
mc