B
Bob H
I have been running a Acess 2007 database on a server for about 15
months, and now I want to delete certain records form it using the
cmdDelete button which has this code behind it:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
Select Case MsgBox("Are you ure you want to delete this record?", vbYesNo)
Case vbYes 'Do nothing: it saves by default.
Case vbNo 'Undo the changes, and close.
End Select
Exit_Save_Click:
Exit Sub
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
Exit_cmdDelete_Click:
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click
End Sub
I have found that the records are not deleted when I click the button,
so what am I missing here.
Thanks
months, and now I want to delete certain records form it using the
cmdDelete button which has this code behind it:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
Select Case MsgBox("Are you ure you want to delete this record?", vbYesNo)
Case vbYes 'Do nothing: it saves by default.
Case vbNo 'Undo the changes, and close.
End Select
Exit_Save_Click:
Exit Sub
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
Exit_cmdDelete_Click:
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click
End Sub
I have found that the records are not deleted when I click the button,
so what am I missing here.
Thanks