TransferText Query

EthanHunt007

New member
Local time
Today, 09:16
Joined
Jan 26, 2008
Messages
9
I have the following command as code for a button on a form to export a query to an csv file,

DoCmd.TransferText acExportDelim, , "Bacs", "C:\" & Format(Now(), "DD-MM-YY") & "_Bacs.csv", False

but if you open it with note pad it has "" around each field, how do i make it so they are not included?

also how do i make it export as "Bacs_10-02-08.csv", instead of "10-02-08_Bacs.csv"

Thanks

Ethan
 
I have the following command as code for a button on a form to export a query to an csv file,

DoCmd.TransferText acExportDelim, , "Bacs", "C:\" & Format(Now(), "DD-MM-YY") & "_Bacs.csv", False

but if you open it with note pad it has "" around each field, how do i make it so they are not included?

also how do i make it export as "Bacs_10-02-08.csv", instead of "10-02-08_Bacs.csv"

Thanks

Ethan

My test table is table1, put "Bacs" in place of Table1
My output goes to drive I:\temp, you could change this to C: or wherever you want the file to be written.

Code:
docmd.TransferText acExportDelim,,"Table1","I:\temp\bas_"& Format(now(),"DD-mm-yy")& ".csv",true

You could try the this, to create a Specification, to remove the " around each field.

Highlight the bas Table; click Export on the File menu; identify the drive and filename; choose txt,csv.. from drop down for filetype; save as delimited; then choose advanced; under text qualifier choose {none}; then save the Specification as MySpec

Now in the docmd statement use
Code:
docmd.TransferText acExportDelim,"MySpec","Table1","I:\temp\bas_"& Format(now(),"DD-mm-yy")& ".csv",true

Good luck
 
Excellent visual Bob.

Thanks - They say a picture is worth a thousand words and, since I hate writing, I like to put into pictures as much as possible :D so I don't have to write so much.
 

Users who are viewing this thread

Back
Top Bottom