Continuous Form Position

A

Alan White

How do you keep the position of the current record in the
same place on the screen when you requery a continuous
form?

lngKeyFldId = me!KeyFldId
me.requery
With me.RecordsetClone
.FindFirst "KeyFldID = " & lngKeyFldId
if not .NoMatch then
me.bookmark = .Bookmark
end if
End with

This locates and displays the record, but shows it at the
top of the continuous form. What is the best way to keep
the record in the same place on the screen as it was
before the requery?

Thank you,
Alan :>)
Sydney NSW Australia
 
M

Marshall Barton

Alan said:
How do you keep the position of the current record in the
same place on the screen when you requery a continuous
form?

lngKeyFldId = me!KeyFldId
me.requery
With me.RecordsetClone
.FindFirst "KeyFldID = " & lngKeyFldId
if not .NoMatch then
me.bookmark = .Bookmark
end if
End with

This locates and displays the record, but shows it at the
top of the continuous form. What is the best way to keep
the record in the same place on the screen as it was
before the requery?


Try playing around with the stuff at
http://www.lebans.com/SelectRow.htm
 
S

Stephen Lebans

Hey Marsh,
that URL actually points the reader to use the newer SetGetScrollBar
solutions. The OP should look at the sample form using the SelTop
property. Very easy to implement.
:)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

http://www.lebans.com/setgetsb.htm
SetGetSB.zip is a database containing functions to allow a user to Set
or Get the current position of a ScrollBar Thumb for a Form.

NEW - Apr. 02/2000 The current ScrollBar position is equal to the
current Record Number being displayed at the Top of the Form.

Works in Form or Datasheet view.

Ver 1.7

Fix bug in SelTop method. Now works with first page of rows properly and
sets the Top row correctly when moving forward in the recordset one row
at a time.

Ver 1.6

Use SelTop to save Restore current row's position after a Requery.

Ver 1.5

Added support for Horizontal ScrollBars.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Rick Vooys said:
Stephen, I can't find the example you are referencing, could you please post a link.
 

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