Hi How to kill a file in this format

kill App.Path & "\backup\backup\PhoneTel.mdb" & Format(Now, "yymmdd_hhnn") & ".mdb"

Lenny

Recommended Answers

All 3 Replies

That should work for you...? Although how would you catch the exact minute of the file name.

Format(Now,"yymmdd_hhnn")

This would give you the minute of it's execution...

If you used;

"PhoneTel.mdb" & Format(Now, "yymmdd_hhnn") & ".mdb"

somewhere else in your code to create this file, you should be saving it at that time to a variable then "Killing" the file via that variable string value.
Let me know if I am making any sense or perhaps I just don't understand your codes circumstances...?

It's hard to do it if you don't know the exact time when the file is saved.
About this case, i think better to have form to manage backup files, so you can choose any backup files to be deleted.

Okej Thanks I will try it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.