Export Query to Tab Delimited Text File VBA Code (1 Viewer)

colonel66

New member
Local time
Today, 04:46
Joined
Jun 14, 2012
Messages
4
hi

I need to export the results of a query to a TAB delimited tex file

i can successfully export the query to a text file, to a specified folder, but the default option is comma delimited and i need TAB delimited.:banghead::banghead:

code:

Code:
DoCmd.TransferText acExportDelim, , "Price_Distribution_Export", FilePath, True

Google says do an export using the wizard and then to save the export. In MS Access 2013 the wizard has no advance tab. so no luck there

Further google research says i must create a Schema.ini File. This seems to be the proper way to do it. So I have created the following text file:

[PriceSpecs.txt]
ColNameHeader=True
Format=TabDelimited
Col1="Message Type Code" Text
Col2="Type Code" Text
Col3="ManCo Code" Text
Col4="Value Date" DateTime
Col5="Price", Double
Col6="Status" Text

The question what are the next steps to get the VBA code to create the export format per the Schema.ini Text File. I know that i need to insert something appropriate in between the commas, but what? And are there other steps i need to do?

Thanks in advance!!!
 

static

Registered User.
Local time
Today, 02:46
Joined
Nov 2, 2015
Messages
823
Google says do an export using the wizard and then to save the export. In MS Access 2013 the wizard has no advance tab. so no luck there

Leave 'Export data with formatting' unticked.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:46
Joined
May 7, 2009
Messages
16,394
Do as name suggests You, save the spec. You must carefully choosechoose tab delimiter while exporting. At the end it will ask to save the spec and name for it. WriteWrite down the name and use it later.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:46
Joined
Feb 19, 2002
Messages
36,296
ALL versions of Access have an "Advanced" button if you have chosen the proper export.
 

Users who are viewing this thread

Top Bottom