Bookmarks

T

Tom T.

I have a form that has a timer event...it requeries the
database to show added or deleted records.

When I do this, the form is reset to the first record. I
need to trap the forms selected record bookmark, do the
requery, then reset the form to the bookmark it was at.

hooowwwww do I doooo thisss??
 
A

Albert D. Kallal

Any requery makes all existing bookmarks invalid.

So, your code will have to save the current key id, and then equerry..and
them move back.

The "air" code would look like


dim lngCurrentID as long

lngCurrentID = nz(me.ID,0)
me.Requery

if lngCurrentID <> 0 then
me.RecordSetClone.FindFirst "id = " & lnCurrentID
me.BookMark = me.RecordSetClone.BookMark
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