Set the subform's AllowDelete property to No, and programmatically delete
the record from the form's RecordsetClone like this:
If Me.Dirty Then
Me.Undo
End If
If Me.NewRecord Then
Beep
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
.Delete
End With
End If
That gives no warning. Add a MsgBox() if you wish.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Sal" <sl*****@bellatlantic.net> wrote in message
news:gYuMc.508$NV3.70@trndny01...
How can I prevent deleting of the record in subform by pressing "Delete"
button on keyboard when record is selected, but still allow VB to delete
record when needed.