Link to home
Start Free TrialLog in
Avatar of proffittware
proffittware

asked on

Export Access Table to Tab Delimited TXT file or fixed

I have done exports to Excel, Dbase etc, but I am having problems with Text files.

I need to export a table to a TAB delimited or fixed-width TXT file.

I have no problem creating the regular delimited (") export, which is the default for Export delimited.

But how do I either do the Export Tab Delimited  or Fixed-Width ? I cannot find anything on what the specificationname should be. I need an example
Avatar of Sean Strickland
Sean Strickland
Flag of United States of America image

This is Tab Delimited:

DoCmd.TransferText acExportDelim, "", "tableName", "C:\My Documents\TableName.txt", True, ""



A good method to find this out is to create a macro using the TransferText command.  Get that to work and save the macro.  Then right click the macro and use Save As / Export and select Save As Visual Basic Module and it will transfer the macro you created to VBA.

HTH,
Sean
BTW,

Replace tableName with your Table's name and replace the file location with your own.
Avatar of proffittware
proffittware

ASKER

Thanks I will try these and get back to you.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That still gave me quotes (") around each field I am exporting.
Capricorn1...once I create this specification name file...if I do this export numerous times can I use it repeatedly ?
Sorry, I missed that part.  Capricorn has described clearly how to create specificiations.  That's what you need.

My apologies,
Sean
proffittware,

in number 4 of my post., if you selected Delimited

you have to use

DoCmd.TransferText acExportDelim, "ExportSpecName", "TableOrqueryName", "C:\mytext.txt", True

<once I create this specification name file...if I do this export numerous times can I use it repeatedly ?>  YES
Capricorn1: Ok...I did what you suggested for Fixed and it worked.  I tried to apply your instructions to the TAB delimited...it gave me tabs between fields, but it also used (") to delimit the fields.

Here is the DoCmd.

  DoCmd.TransferText acExportDelim, "FTPExportTab Export Specification", "FTPExport", "C:\Canada\exporttab.txt", True, ""
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry about the last comment, did not see your comment of 2:39 ...I will try and get back
Thanks to both for the information.