Here is some updated code that should work with your parameter query, but the solution in post #7 would probably be easier:
Code:
Dim db as DAO.Database,rsDelete as DAO.Recordset
Dim sServerPath as string, sFileName as String, sFullFileName as string
Dim prm as Parameter, qdf as DAO.QueryDef
Set db=CurrentDB
'Set rsDelete = db.OpenRecordset ("Select * From qryRecordsReportAttachment;",dbOpenSnapShot)
Set qdf = db.QueryDefs("qryRecordsReportAttachment")
For each prm in qdf.Parameters
prm.Value=Eval(prm.name)
Next prm
Set rsDelete = qdf.OpenRecordset dbOpenSnapShot
If rsDelete.RecordCount=0 Then Exit Sub
Do until rsDelete.EOF
sServerPath = rsDelete("Path") 'replace with the server path field name
if Right(sServerPath,1)<>"\" Then sServerPath =sServerPath & "\"
sFileName =rsDelete("AttachmentName") 'replace with the file name field name
sFullFileName =sServerPath & sFileName
Kill sFullFileName 'delete the file
rsDelete.MoveNext
Loop
Set rsDelete = Nothing
Set db =Nothing
Cheers,