Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro export to true text

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
0
0
GB
i am using access 2003. I want to export the results of a query via a macros to a trues test file. When I do this it puts all sort offormating in boxes/pipes around the data. How can i solve this?
 
just normal text on one line seperated by ,

F,TEST,99999,12234 ETC
 
no thats the issue, it allows excel and text but the text output is not what i call text, it has pipes in etc etc. try it and see. can someone help please?
 
mart10,
Can we assume there are no commas in your data field values?

Did you try step through the export wizard to create and save a specification that can be re-used?

Duane
Hook'D on Access
MS Access MVP
 
no commas in data fields

I am using macro to export. when you pick the export type text and call it a ....txt file it shows the fields in columns seperated by pipes etc Not useable
 
Don't use this method. Right click the table/query and choose Export. Step through the wizard and at some point you should be able to click [Advanced]. This gives you greater control and allows you to save the specifications.

Duane
Hook'D on Access
MS Access MVP
 
Ha The trouble is I am writing this for a 'Muppet' so I am designing a macro for him. There is an initial delete querry followed by about 20 append queries. Everything is working perfect apart from need to generate the text as final part. The other option would be to save as CSV but access macros dont allow this. my final option would be to save as excel and then get the muppet to take off the header columns and save as CSV but Id really rather automate the whole thing!
 
You can export to a csv format file with code like:
Code:
 DoCmd.TransferText acExportDelim, , strQuery, Me.txtFileName, Me.chkIncludeHeadings
strQuery is a query name, txtFileName is the destination file name, and chkIncludeHeadings is a boolean

Duane
Hook'D on Access
MS Access MVP
 
Look at bookmarks

Never give up never give in.

There are no short cuts to anything worth doing :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top