Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Fri, 17 Mar 2006 05:22:28 -0800,    group: microsoft.public.access.externaldata        back       


How do I append to a text file when exporting from Access or Excel   
I want to export to a text file from an Excel or Access macro.
I need to look to see if that file name already exists, and if it does, 
append data to the end of that file, otherwise just write the file.
date: Fri, 17 Mar 2006 05:22:28 -0800   author:   aimwhy

Re: How do I append to a text file when exporting from Access or Excel   
Access's built-in facilities don't allow you to append data to a text file. 
Any of these approaches will do it:

A) export your second file in the normal way and then concatenate it to the 
existing file (using Dir() to check whether it exists, and Shell() to call 
the Windows COPY command to do the actual concatenation.

B) temporarily import the existing file into an Access table, append the new 
data, and export it all to a new text file.

C) open a recordset on the data you want to export, open the existing file 
using the VBA Open ... For Append ... statement, and use VBA code to write 
the new data line by line.

"aimwhy"  wrote in message 
news:202A02B2-9C4D-4746-A238-8384796959EA@microsoft.com...
>I want to export to a text file from an Excel or Access macro.
> I need to look to see if that file name already exists, and if it does,
> append data to the end of that file, otherwise just write the file.
>
date: Fri, 17 Mar 2006 14:49:52 -0000   author:   John Nurick

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us