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

colonel66

New member
Local time
Today, 07:07
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, 05:07
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, 13:07
Joined
May 7, 2009
Messages
19,169
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
Today, 01:07
Joined
Feb 19, 2002
Messages
42,981
ALL versions of Access have an "Advanced" button if you have chosen the proper export.
 

Users who are viewing this thread

Top Bottom