Put something like this in the form's Delete event procedure:
Const conMESSAGE = _
"Are you sure you wish to delete this record."
If MsgBox(conMESSAGE, vbOKCancel + vbQuestion, "Delete Record") _
= vbCancel Then
Cancel = True
End If
and this in its BeforeDelConfirm procedure:
Response = acDeleteOK
If you have added a button to the form for deleting the current record
rather than simply relying on the standard toolbar, menu or keyboard methods.
you'll need to handle the error which will arise on cancellation, with code
like this in the button's Click event procedure:
Const DELETECANCELLED = 2501
On Error Resume Next
RunCommand acCmdDeleteRecord
Select Case Err.Number
Case 0
' no error
Case DELETECANCELLED
' anticipated error
' so do nothing
Case Else
' unknown error
' so inform user
MsgBox Err.Descriptiom, vbExclamation, "Error"
End Select
Ken Sheridan
Stafford, England