using bookmark in continuous form

J

Jesper Fjølner

If the ID field on a continuous subform is "recID".
How do I :
"remember" this (as a bookmark with recordsetclone?) > Requery the subform
and then go to the bookmarked record (so it again becomes the current
record?)

Jesper
 
P

Pat Hartman\(MVP\)

Bookmarks are recreated when a recordset is requeried so you can't
"remember" a bookmark from before the requery and use it after the requery.

Save the unique ID of the record and use it with the FindFirst method after
the requery.
 
J

Jesper Fjølner

Bookmarks are recreated when a recordset is requeried so you can't
"remember" a bookmark from before the requery and use it after the
requery.

Save the unique ID of the record and use it with the FindFirst method
after the requery.


I'm having some trouble with this.
For now I'm putting the unique ID in a textfield on the form 'tmp', but I
guess I could use a global variable.
After requerying the subform (sub1) how do I make the record 'tmp' on sub1
the active record instead of the first record (as it happens with a
requery)?

Jesper
 
P

Pat Hartman\(MVP\)

Here's some sample code:

Dim varID As Variant

varID = Me.ProductID.Value
Me.Requery
If Not IsNull(varID) Then
Me.Recordset.FindFirst "productID=" & varID
End If
 
J

Jesper Fjølner

Here's some sample code:
Dim varID As Variant

varID = Me.ProductID.Value
Me.Requery
If Not IsNull(varID) Then
Me.Recordset.FindFirst "productID=" & varID
End If

Thansk very much, that did it :)


Jesper
 
Top