I have a database that creates a backup database, and places it in a separate folder, when opened. The backup database's name is test_mm/dd. I want the ten day old database to be deleted at the same time. Suggestions?
I know the name. I have several databases that I back up. Once the database back up is ten days old, I want to auto delete. This could be done when the current database is opened.If you know the name, VBA has a verb for this... KILL file-spec
If you DON'T know the name, look up the FileSystemObject, which you can use to look at files, search by name, and delete by name once you found what you wanted.
![]()
I have six databases that I want to do this with. I might also expand this to all Access databases.I always keep 7 days of my current development project I was thinking of automating the delete but to be honest I didn't want to leave it to code, It's just me on that but i find it simple to open the folder and delete a few files job done in 10 seconds
Then do what the Doc Man said.I know the name. I have several databases that I back up. Once the database back up is ten days old, I want to auto delete. This could be done when the current database is opened.
The Doc Man didn't suggest a way to do this when the main database is opened, which is my question.Then do what the Doc Man said.
The Doc Man didn't suggest a way to do this when the main database is opened, which is my question.
Yes, he did. Use the KILL command. You'll probably need to add in some Date functions to figure out the correct filename, tooThe Doc Man didn't suggest a way to do this when the main database is opened, which is my question.