Hello,
I have a problem with a block of code I'm trying to use that enables me to delete a file from not only the database, but the referenced folder in which the file is located.
It will delete the file from the database (removes the picture from the form), but doesn't permantely remove the file. Here's what I have:
Private Sub Form_AfterDelCo nfirm(Status As Integer)
Dim DeleteFilename As String
If Status = acDeleteOK Then
If Len(DeleteFilen ame) > 0 Then
Dim DeleteImgPath As String
DeleteImgPath = GetImageFolder & "Images\" & DeleteFilename
' Delete the image file if it exists
If Dir(DeleteImgPa th) <> vbNullString Then Kill DeleteImgPath
End If
End If
DeleteFilename = ""
End Sub
This is a subForm amongst other code that I have. Also, I get a complier error - mismatch type for the ampersand on the 6th line of code.....
Any insight anyone could give would be most appreciated.
Thanks in advance.
I have a problem with a block of code I'm trying to use that enables me to delete a file from not only the database, but the referenced folder in which the file is located.
It will delete the file from the database (removes the picture from the form), but doesn't permantely remove the file. Here's what I have:
Private Sub Form_AfterDelCo nfirm(Status As Integer)
Dim DeleteFilename As String
If Status = acDeleteOK Then
If Len(DeleteFilen ame) > 0 Then
Dim DeleteImgPath As String
DeleteImgPath = GetImageFolder & "Images\" & DeleteFilename
' Delete the image file if it exists
If Dir(DeleteImgPa th) <> vbNullString Then Kill DeleteImgPath
End If
End If
DeleteFilename = ""
End Sub
This is a subForm amongst other code that I have. Also, I get a complier error - mismatch type for the ampersand on the 6th line of code.....
Any insight anyone could give would be most appreciated.
Thanks in advance.
Comment