TransferText Comma Delimitted File

Moxioron

Active Member
Joined
Mar 17, 2008
Messages
436
Office Version
  1. 2019
Hello all.

I have some VBA that transfers a query to a text file.

DoCmd.TransferText acExportDelim, , "qry_VISA Statement Final Index", "R:\DEPT-BR\CONSUMER LENDING\VISA\VISA Statements\VISA Statement Final Index.txt", False

Two issues:

1.) I have two expressions in my query that don't transfer (they show up on the query when I run it)
2.) I don't want the quotes around each field

Thoughts, feedback, suggestions? Thank you.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
1.) I have two expressions in my query that don't transfer (they show up on the query when I run it)
What are some examples of these values for these that show up in your query but not in the exported files?
What gets exported in its place (just a blank betweem commas)?
2.) I don't want the quotes around each field
Create an Export Specification and use that in your export (it is the first argument after "acExportDelim").
All you need to do to accomplish this is go through the process of exporting the file manually using the Export Wizard, and just before you click Finish, click on the button that says "Advanced", and change the value in the Text Qualifier option from a double quote (") to {none}. Then click Save As and give your export specification a name.

Then just add that to your code.
Rich (BB code):
DoCmd.TransferText acExportDelim, YourExportSpecificationNameHere, "qry_VISA Statement Final Index", "R:\DEPT-BR\CONSUMER LENDING\VISA\VISA Statements\VISA Statement Final Index.txt", False
 
Upvote 0
Thanks so much for the response.

I have two expressions that prompt the user to type a value. They show up in the query just fine and when I copy and paste into Excel they are there. However, they are just empty spaces on an export.

I tried your suggestion about saving the export,but during the export if I don't select 'Export Data with formatting and layout' I get a 'Too few parameters. Expected 1' message.
 
Upvote 0
Which version of Access are you using?
 
Upvote 0
Can you post the SQL code of the query you are trying export?
 
Upvote 0

Forum statistics

Threads
1,203,673
Messages
6,056,678
Members
444,881
Latest member
Stu2407

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