First im in no way a programer and I cant figure out how to chang that to newbie....
I have a form (frmVWI) with a subfrm (frmVWISubform) and on the form I have a delete button
that I have to delete the images that are stored in a folder outside the database. The subfom
has a table called tblJobSteps which has a field called (ImagePath) and when a path is saved it
looks like (\VWI_Images\1.jpg). anyways I had someone help me with what I have now but its not
doing anything. Oh and there might be several images associated with the record thats why it needs to
loop threw each one and kill the image. Any thoughts?
Thanks,
SoggyCashew.....
I have a form (frmVWI) with a subfrm (frmVWISubform) and on the form I have a delete button
that I have to delete the images that are stored in a folder outside the database. The subfom
has a table called tblJobSteps which has a field called (ImagePath) and when a path is saved it
looks like (\VWI_Images\1.jpg). anyways I had someone help me with what I have now but its not
doing anything. Oh and there might be several images associated with the record thats why it needs to
loop threw each one and kill the image. Any thoughts?
Code:
Private Sub cmdKillDelete_Click()
Dim rst As DAO.Recordset
Dim strTableName As String
Dim strSQL As String
strSQL = "Select * From tblJobSteps Where JobStepID = " & Me!VWIID
Set rst = CurrentDb.OpenRecordset(strSQL)
Do Until rst.EOF
If Dir(rst!ImagePath) <> "" Then
Kill (rst!ImagePath)
End If
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
Thanks,
SoggyCashew.....