rst.Bookmark vs rst.CurrentRecord

L

Laurel

I need to be able to identify the current record, and then make it current
again, after executing a .movelast .movefirst (which I need to do in order
to have a current record if there's only one record in the recordset and I
have moved to it, just retrieved it.... go figure).

Anyway, I can see how to find out the value of <recordset>.currentrecord or
<recordset>.bookmark, but I can't find out how to use those values to make
that record current again.

TIA for any help.
 
M

MacDermott

You could try code like this:
dim bkmk as variant
with rst
bkmk=.bookmark
.movelast
.movefirst
.bookmark=bkmk
end with

But if you don't have a current record, I can't see how you'd have a
bookmark or currentrecord property either...

- Turtle
 
L

Laurel

But if you don't have a current record, I can't see how you'd have a
bookmark or currentrecord property either...

Hmm... Good point. I've revised my approach to use this (having recently
learned about BOF).
This seems to work OK. In this context there would never not be any rows at
all.

If lrstMe.BOF = True Then
lrstMe.MoveFirst
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top