First, this has nothing to do with your problem, but a Delete is not an Edit.
You don't need .Edit and .Update with .Delete, and the results of using them
are undefined, so don't.
Next, if the form is on a new record, the record is not saved in the
recordset, yet, so it has no bookmark, and it is not visible in the clone.
You need to check for this Me.Newrecord, and execute Me.Undo instead of
deleting the record in this case.
Finally, if you are in Access 2000 or newer, I don't think you need to use the
RecordsetClone or bookmarks, just do Me.Recordset.Delete.
On 23 Oct 2004 15:44:40 -0700,
we*****@verizon.net (Weaver) wrote:
Seems like this ought to work:
Set rs = Me.RecordsetClone
rs.Bookmark = Me.Bookmark
rs.Edit
rs.Delete
rs.Update
Set rs = Nothing
Exit Sub
Occasionally the rs.Bookmark = Me.Bookmark statement fails with a 'no
current record' error. I would like to know how to handle this
situation. One or more fields of the record may have data in them and
Newrecord may be true.