There could be lots of reasons why a deletion cannot compete, e.g.:
- The record is dirty and cannot be saved. Try undoing the form, and then
deleting.
- The code is being executed in a inappropriate event (such as the KeyDown
of a text box that has a BeforeUpdate event that can't complete, and so the
changes to the record cannot be handled, and so the record cannot be
deleted.)
- The form is a Popup, and uses DoMenuItem to attempt the delete. Try:
RunCommand acCmdDeleteRecord
- The form's AllowDeletions property is No.
- The form or its recordsource or the data file or network share or drive
(CD) is read-only.
- The form is at a new record, or there are no records in the form, so there
is nothing to delete.
- The user does not have delete permissions (Access security).