I use a function to read all of the files from a couple of directories
(and subfolders) and update a table(tblfiles) with the fullpath and
file name, the filesize and the date the file was created. I then
manually select files to delete by clicking on a yes/no checkbox. I
have a query (qryfiledelete) which selects all of the files from
tblfiles where the yes/no field is yes.
What I want to do is run a function which will delete (Kill?) these
files from the computer. I have searched google and can find lots of
examples of how to delete the files and only one : -
Dim db As Database
Dim rst As Recordset
Dim strPathName As String
Set db=CurrentDb
Set rst =db.OpenRecords et("qryfiledele te")
Do Until rst.EOF
Kill rst!PathName
rst.MoveNext
Loop
But get an error on the Kill line - Compile Error, Expected Variable
or Procedure, not Project.
Can anyone see what I am doing wrong?
Thanks
David
(and subfolders) and update a table(tblfiles) with the fullpath and
file name, the filesize and the date the file was created. I then
manually select files to delete by clicking on a yes/no checkbox. I
have a query (qryfiledelete) which selects all of the files from
tblfiles where the yes/no field is yes.
What I want to do is run a function which will delete (Kill?) these
files from the computer. I have searched google and can find lots of
examples of how to delete the files and only one : -
Dim db As Database
Dim rst As Recordset
Dim strPathName As String
Set db=CurrentDb
Set rst =db.OpenRecords et("qryfiledele te")
Do Until rst.EOF
Kill rst!PathName
rst.MoveNext
Loop
But get an error on the Kill line - Compile Error, Expected Variable
or Procedure, not Project.
Can anyone see what I am doing wrong?
Thanks
David
Comment