Solved: VBA to delete FILE

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

tomlock2

Thread Starter
Joined
Nov 20, 2011
Messages
49
I'm using Windows 7 and Access 2010. I want to delete all *.PDF files in a certain folder using a VBA command within ACCESS. I have tried all kinds of formats with the KILL statement unsuccessfully. Any help deeply appreciated.

I've tried ---

KILL ("C:\pathname\*.PDF")
KILL "C:\pathname\*.PDF"

I've tried it with many other variations. I've even tried it with an explicit filename and the file exists before executing the command.

In all cases the code errors out.
 
Joined
Jul 29, 2001
Messages
21,334
Create a button and put this in the onClick event

Kill "C:\whatever\*.pdf"

Once the files are gone they cannot be retrieved from the recycle bin.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top