How to delete a file from folder from Access?

Niroth

Registered User.
Local time
Today, 12:43
Joined
Jul 12, 2007
Messages
81
Hi,

I'm trying to delete all the files from a folder once I've copied it to another location. Now stuck at trying to find a code to do the deletion. Tried deleteFile function, also object.delete,

something like this:

Code:
dim myObject as object
 
set myObject=me.path 'path contains the pathway to the file I want to delte
 
myObject.delete 'doesn't work the way the access help said it's supposed to

Help?
 
Look up Kill Statement in access help

JR
 
Thanks. For future reference to anyone as clueless as me:

Kill ("path to the file you want to delete here") will delete the file.

To get the paths to all the file you want from a folder:

Dir ("path to the folder here")

use some kind of filter to single out a file you want to use.
 

Users who are viewing this thread

Back
Top Bottom