473,503 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bookmarks and Deletes with No Current Record

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
2 4004
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3411
by: (Pete Cresswell) | last post by:
Seems like when there's a 1:1 relationship, the order of referential integrity enforcement depends on which way you drag the mouse pointer when drawing the relationship line. If you drag from...
0
1613
by: Frnak McKenney | last post by:
One part of a customer project I'm working on involves what seem like fairly straightforward updates to a set of related tables. While I've developed software for a number of years (it only seems...
1
1820
by: keithv | last post by:
Is there anyway to have cross-file bookmarks? I'd want to be able to quickly jump to a specific spot in a specific file. The toolbar bookmark command only seems to work within the current...
9
1856
by: Tim | last post by:
Hi, has anyone experienced a spontaneous loss of a subform bookmark (i.e. resetting to the first record), when the computer is idle. I used to have a problem in NT4 when doing a couple of...
9
24281
by: Johnfli | last post by:
ADODB.Recordset error '800a0cb3' Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype. I am moving my webserver from NT4 using SQL...
4
1437
by: Viviana Vc | last post by:
Hi all, I used until now Visual Studio 2003 and now I updated to Visual Studio 2005 and I have problems with the bookmarks. 1) until now if you had several bookmarks into one document, with F2...
2
1371
by: AA Arens | last post by:
When I add a button and choose in the wizzard for Delete Record operation, it does not work, instead it ADD's a record? How come? This is the VB contents of the button: Private Sub...
3
3902
by: Bob Alston | last post by:
Anyone know how to disable or redefine the Ctrl - hotkey which deletes a record? I have a multi page form that uses 14 records, each record handles 1-2 pages of the 18 page form. Occasionally ,...
0
7204
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7464
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.