Delete Source File

G

Guest

I have a server that creates a Comma Del. File that I use Access to retreive
information out of using a macro. My question, is there a way to delete the
source file within the same macro after the data is imported?
 
S

Steve Schapel

Greg,

No, not directly with a macro. You will need a VBA procedure, using the
Kill method, to delete the file. You can make a function in a VBA
module to delete the file, and then use a RunCode action in the macro to
make it happen.
 
S

Steve Schapel

Greg,

In your Database Window, select the Modules tab, and click New. Type
the equivalent of this...
Public Function RemoveFile()
Kill "C:\YourFolder\YourFile.txt"
End Function

Then, put a RunCOde action in your macro, and in the Function Name
argument, put like this...
=RemoveFile()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top