scroll on an updating record list

  • Thread starter Thread starter Julie
  • Start date Start date
J

Julie

I have a form with a continuous subform listing records
showing a data value.

The data values change, so based on a timer I refresh the
subform.

If I want to scroll down my subform with the down arrow I
jump back to the top every time my data is refreshed.

Can I keep the position AND refresh my data?

I believe I can program to reposition with curren record
and bookmark etc. - but is there a simpler way - and I
dont want it to go to the top and then reposition. I just
want to stay at the current record while it refreshes.
 
Refresh will change all the memory pointers between what the UI is
displaying and where the data is located. What would happen if the record
you are on is suddenly removed?


Try something along these lines



Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone
rst.FindFirst "[UniqueRecordID]=" &
variableContainingTheUniqueIDYouWereOn
If rst.NoMatch Then
MsgBox "No entry found.", vbInformation
Else
Me.Bookmark = rst.Bookmark
End If

Set rst = Nothing
 
That's how i figured it to go. Will try it.

Records are never deleted - only the data is refreshed.
-----Original Message-----
Refresh will change all the memory pointers between what the UI is
displaying and where the data is located. What would happen if the record
you are on is suddenly removed?


Try something along these lines



Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone
rst.FindFirst "[UniqueRecordID]=" &
variableContainingTheUniqueIDYouWereOn
If rst.NoMatch Then
MsgBox "No entry found.", vbInformation
Else
Me.Bookmark = rst.Bookmark
End If

Set rst = Nothing




I have a form with a continuous subform listing records
showing a data value.

The data values change, so based on a timer I refresh the
subform.

If I want to scroll down my subform with the down arrow I
jump back to the top every time my data is refreshed.

Can I keep the position AND refresh my data?

I believe I can program to reposition with curren record
and bookmark etc. - but is there a simpler way - and I
dont want it to go to the top and then reposition. I just
want to stay at the current record while it refreshes.


.
 
Back
Top