A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

export text file in macro



 
 
Thread Tools Display Modes
  #1  
Old November 15th, 2006, 07:46 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba
-DwayneWade
external usenet poster
 
Posts: 4
Default export text file in macro

I am writing an export text file function in macro using Access 97. I use
transfertext and export delimited. However when I run this macro, I got an
error message "the file is already existed" and stop processing. How can I
delete the file before I run this process in a macro? Thanks.


  #2  
Old November 15th, 2006, 12:11 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba
Alex Dybenko
external usenet poster
 
Posts: 85
Default export text file in macro

Hi, you can use Kill statement:

strFile="c:\1.txt"

if len(dir(strFile)) 0 then
kill strFile
end if

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


" -DwayneWade" wrote in message
...
I am writing an export text file function in macro using Access 97. I use
transfertext and export delimited. However when I run this macro, I got an
error message "the file is already existed" and stop processing. How can I
delete the file before I run this process in a macro? Thanks.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.