VBA for export query database to text UTF-8 without header field

su2009

Board Regular
Joined
Sep 24, 2010
Messages
81
hi i am new to Microsoft access. I have the following query data:

CodeName Date RAmt
AA003
PEN31/10/2016 LA0.59
AA003
PEN31/10/2016 NN10.78
AA003
PEN31/10/2016 CT2.4
AA003
PEN31/10/2016 TU2.58
AA003
PEN31/10/2016 LI90.39

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

I need a VBA for export query database to text UTF-8 without header field and save in a folder. Also i would like the text file display "" and | for each column. Example as follows:

"AA003"|"PEN"|"2016-10-31"|"LA"|"0.59"
"AA003"|"PEN"|"2016-10-31"|"NN"|"10.78"
"AA003"|"PEN"|"2016-10-31"|"CT"|"2.40"
"AA003"|"PEN"|"2016-10-31"|"TU"|"2.58"
"AA003"|"PEN"|"2016-10-31"|"LI"|"90.39"

Any help is highly appreciated. Thank you.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
hi alansidman,

yeah, i managed to get it done. here is my vba:

Public Sub export_query()

DoCmd.TransferText transferType:=acExportDelim, SpecificationName:="Final_Result Export Specification", TableName:="Final_Result", FileName:="C:\Users\USER\Desktop\Final_Result.txt", hasfieldnames:=False, CodePage:=65001


End Sub

Thanks. i learn something today
 
Upvote 0

Forum statistics

Threads
1,221,783
Messages
6,161,938
Members
451,730
Latest member
BudgetGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top