Modify delete code-still need help

  • Thread starter Thread starter Liane
  • Start date Start date
L

Liane

Guest
Please see my previous post. I don't know access programming, so please give me more detailed help on the code I can use to replace the code that access generates to delete a record. I want something like this.

Message "are you sure you want to delete this record" (there are yes or no buttons)
if yes is pressed then the record gets deleted, if no is pressed then I guess the subroutine ends.
Can someone please provide the code for me?
Thank-you.
 
My wife makes me put in these 'fail safe's all the time. Here you go:

If MsgBox("Are you sure you want to delete this customer? " _
& "This action is not un-doable.", vbOKCancel, "Deletion Confirmation") _
= vbCancel Then
MsgBox "No customer was deleted.", , "Action Canceled"
Exit Sub
Else
DoCmd.RunCommand acCmdDeleteRecord
MsgBox "Customer was deleted.", , "Deletion Execution"
End If
 

Users who are viewing this thread

Back
Top Bottom