Return to record

S

Snowsride

I am working with two recordsets A and B. Recordset A has a date field and
for a current record this is null. I have some code that finds the first
occurrence of a null value date and then moves back n times to find a record,
it then takes the values of that record and creates a new record in Recordset
B.

I want to be able to return to the null value record in A so that my code
can continue. I think I need to assign the Bookmark property of the null
date value record to a variable and then be able to return to the Bookmark
later but how do I do this?

Thanks
 
W

Wayne Morgan

Yes, as long as you don't change the recordset A, bookmark should work.

Example:
Dim lngBookmark As Long
'find your record
lngBookmark = RecordsetA.Bookmark
'move back and get your value
RecordsetA.Bookmark = lngBookmark

Another option would be to get the value of the unique ID field for the
record then do a FindFirst on this value when you're ready to go back to the
record. Since there will only be one (it's a unique value), that will move
you back to the record also. This will also work even if you've done
something to make the bookmark value invalid.
 

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