Exporting to Text File

  • Thread starter Thread starter Stephen C Smith
  • Start date Start date
S

Stephen C Smith

Guest
What is the best way to export info to a text file where the format requires a specific length for each field rather than delimiting it with commas?

A number of years ago, I did an application in Access 97 that dealt with text files by using commands like "Write #1" and "Read #1." I'm not finding these commands in Access 2000 and Access 2002 documentation. Do they still work or have they been dropped?

I suppose I could just make a string variable and concatonate all of the info into it with CR's at the end of each line. If I do that, what command should I use to save it as a text file?


Thanks for the Help!

Stephen S.
 
First of all you need to pick your table or query to export.
Then go to file,export. Set your file type as txt,csv etc..Choose delimited or fixed width. Hit the advanced button. Amend your settings as appropriate then click save as and save your specification name. Cancel out of the wizard.

Once you have saved your specification name you can use the following code:

DoCmd.TransferText acExportFixed, "YourSpecificationName", "YourTable/Query", "FullPathName", True, ""


Hope this helps

Dan
 

Users who are viewing this thread

Back
Top Bottom