A
Afrosheen via AccessMonster.com
Thanks for reading this and taking the time to answer my question.
I have a form with a employee picture in it. The picture is in another folder.
What I want to do is when I delete the employee record, the picture will also
be deleted.
The structure of the folder is:
C:\NCI Database\NCI Pictures.
A picture name would be something like: SVT.JPG It is based on a field
{StaffId} in the employee table plus JPG. In the same table is the SVT.JPG
under the field called picid.
The table for the employee record is stored at least right now under the NCI
Database.
The code from the form is:
Private Sub delrecord_Click()
10 On Error GoTo Err_delrecord_Click
20 If MsgBox("Do You Really Want to Delete " & Chr(13) & Chr(10) & Chr(13)
& _
UCase([Fname]) & " " & UCase([Lname]) & "?", vbExclamation + vbYesNo) =
vbYes Then
30 DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
40 DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
50 Else
60 DoCmd.OpenForm "frmyoucoward", acNormal, "", "", acReadOnly, acNormal
70 DoCmd.RepaintObject acForm, "frmyoucoward"
80 End If
Exit_delrecord_Click:
90 Exit Sub
Err_delrecord_Click:
100 If Err.Number <> 2501 Then MsgBox Err.Description
110 Call LogError(Err.Number, Err.Description, "delrecord_click()")
'MsgBox Err.Description
120 Resume Exit_delrecord_Click
End Sub
Any help would be appreciated.
Thanks.
I have a form with a employee picture in it. The picture is in another folder.
What I want to do is when I delete the employee record, the picture will also
be deleted.
The structure of the folder is:
C:\NCI Database\NCI Pictures.
A picture name would be something like: SVT.JPG It is based on a field
{StaffId} in the employee table plus JPG. In the same table is the SVT.JPG
under the field called picid.
The table for the employee record is stored at least right now under the NCI
Database.
The code from the form is:
Private Sub delrecord_Click()
10 On Error GoTo Err_delrecord_Click
20 If MsgBox("Do You Really Want to Delete " & Chr(13) & Chr(10) & Chr(13)
& _
UCase([Fname]) & " " & UCase([Lname]) & "?", vbExclamation + vbYesNo) =
vbYes Then
30 DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
40 DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
50 Else
60 DoCmd.OpenForm "frmyoucoward", acNormal, "", "", acReadOnly, acNormal
70 DoCmd.RepaintObject acForm, "frmyoucoward"
80 End If
Exit_delrecord_Click:
90 Exit Sub
Err_delrecord_Click:
100 If Err.Number <> 2501 Then MsgBox Err.Description
110 Call LogError(Err.Number, Err.Description, "delrecord_click()")
'MsgBox Err.Description
120 Resume Exit_delrecord_Click
End Sub
Any help would be appreciated.
Thanks.