Hi, I am trying to export a table to a simple text file that looks like this using VBA code under a button.
Type something anything|Checked|1|Western lowland gorilla
Type something anything|Checked|2|Greater flamingo
Type something anything|Checked|3|Lesser Antillean iguana
Type something anything|Checked|4|Trinidad stream frog
I have used this code that I got from another thread
I set the the advanced options of a table export to create me a new import/export file specification called "text file" which set the field delimeter to | and text qualifier to None. This works great on a manual export but when I try and use the VBA code I get comma's seperating the field headers not "pipes" and no delimeters between the data just massive gaps.
Thanks for your reply - if you mean export assistant as in when you right hand click on a table and choose export then click advanced and create your own file specifications, thats how I created the "text file" export file spec which is referenced in the VBA code.
Is there a way in VBA that you can write how you want the text to be formatted and seperated in the code.
looks like your original option may be wrong... here's a list of the options for that:
AcTextTransferType can be one of these AcTextTransferType constants.
if you want to use a delimiter, you'll have to choose acExportDelim. acExportFixed sets up a fixed-width text file, regardless of delimiter settings you chose in your specifications file, hence the spaces between your fields...
i'm guessing that if you checked, they'd correspond to the field widths in your table.
for syntax of the rest of the arguments, search on "transfer text" in VBA.