By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Bookmarks and Deletes with No Current Record

P: n/a
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.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.


Nov 13 '05 #2

P: n/a
Thank you ever so much.
Steve Jorgensen <no****@nospam.nospam> wrote in message news:<pl********************************@4ax.com>. ..
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.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.