View Full Version : How to delete a file from folder from Access?


Niroth
06-18-2009, 09:36 PM
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:


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?

JANR
06-18-2009, 09:47 PM
Look up Kill Statement in access help

JR

Niroth
06-20-2009, 01:26 AM
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.