Export Query to Tab Delimited Text File VBA Code

colonel66

New member
Local time
Today, 08:54
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!!!
 
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.
 
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.
 
ALL versions of Access have an "Advanced" button if you have chosen the proper export.
 

Users who are viewing this thread

Back
Top Bottom