By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

Displaying (scrolling to) a specific record in a continuous form with VBA

P: n/a
I am a good programmer, but this one stumps me!

I have a form with a continuous subform. The continuous subform
contains records of data and may reach a depth of 1000's of entities.
I have created a search button on my form and it does its job quite
well. It presents the user with an inputbox, prompting for the string
to search. Then the code returns with a record number of the record
which contains the string.
Here's the problem. I want the subform to display the found record
within the visible area (as if the user scrolled down to it) of the
subform.
By default, the continuous subform displays records 1-30. Let's say the
search button returns the number 500. How can I get my continuous
subform to display starting with record 500, 501, 502, etc.?

Good Luck?

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
See the SelTop sample form here:
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.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Typehigh" <nm******@usatoday.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
I am a good programmer, but this one stumps me!

I have a form with a continuous subform. The continuous subform
contains records of data and may reach a depth of 1000's of entities.
I have created a search button on my form and it does its job quite
well. It presents the user with an inputbox, prompting for the string
to search. Then the code returns with a record number of the record
which contains the string.
Here's the problem. I want the subform to display the found record
within the visible area (as if the user scrolled down to it) of the
subform.
By default, the continuous subform displays records 1-30. Let's say the search button returns the number 500. How can I get my continuous
subform to display starting with record 500, 501, 502, etc.?

Good Luck?


Nov 13 '05 #2

P: n/a
Typehigh wrote:
I am a good programmer, but this one stumps me!

I have a form with a continuous subform. The continuous subform
contains records of data and may reach a depth of 1000's of entities.
I have created a search button on my form and it does its job quite
well. It presents the user with an inputbox, prompting for the string
to search. Then the code returns with a record number of the record
which contains the string.
Here's the problem. I want the subform to display the found record
within the visible area (as if the user scrolled down to it) of the
subform.
By default, the continuous subform displays records 1-30. Let's say the
search button returns the number 500. How can I get my continuous
subform to display starting with record 500, 501, 502, etc.?

Good Luck?


Set rst = Me("SubformName").Form.Recordsetclone
rst.findfirst "IDField = " & KeyToFind
Me("SubFOrmName").Form.BookMark = rst.BookMark
Nov 13 '05 #3

P: n/a
I copied the code modules and tweeked the vba to conform to my
application and it worked perfectly.

Thanks!

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.