FindRecord Feature

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a form that pops up a subform to enter extra detail
for the record on the main form. Once I am done with
entering the extra data, I requery the main form in order
for the records to update on the screen. The problem is
the record that I edited is not selected anymore. Is
there anyway to reselect the record that I was on before.

Thanks,
John
 
Hi,


You have to store the "key" value in a variable before you requery.
Indeed, LastModified is a bookmark, but would be invalid after the requery.
So, if you do not requery:


Me.Bookmark = Me.RecordsetClone.LastModified


would do. But with a requery, something like :

Dim pk As Long
pk=primaryKeyFieldValue
Me.Requery
Me.RecordsetClone.FindFirst "PrimaryKeyField=" & pk
Me.Bookmark = Me.RecordsetClone.Bookmark


should do. I assumed the primary key value was numerical (long integer).




Hoping it may help,
Vanderghast, Access MVP
 
Back
Top