Delete Source File

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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()
 
Back
Top