I'm using the Kill statement to delete some files after creating them from a MS Access report and then emailing them as an attachment. I get the Permission denied Error on the Kill statement. What's odd is that I don't always get the error. One time it will work fine and the next time I'll get the error. Is there anything I can do to avoid getting this error?
I'm developing on a machine with 07 but the DB is saved in 03 format
Here is the code.
If Dir(strFilePath & "pdfReport1.pdf") <> "" Then
Kill strFilePath & "pdfReport1.pdf"
If Dir(strFilePath & "pdfReport2.pdf") <> "" Then
Kill strFilePath & "pdfReport2.pdf"