473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
3 15285
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
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
I copied the code modules and tweeked the vba to conform to my
application and it worked perfectly.

Thanks!

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
3
by: Mark | last post by:
Hi there, I have a subform, set as a continuous form. When a user selects a particular record in that subform, how can I make that particular record stand out (color or font change, size, etc) from...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
3
by: Lyn | last post by:
I need some guidance for a technique that will allow me to accomplish the following... I have a table in which each record contains a photograph. I would like to display in a form a thumbnail...
1
by: NumberCruncher | last post by:
Hi All, I am struggling with setting up my first system of tables, forms,and reports, and could use your help! I am setting up a database to keep track of the production of a produced item. The...
2
by: Wayne | last post by:
Is there a workaround to the bug that loses the first record in a continuous form after using the scroll wheel if the available records don't fill the form? I know that the "up arrow" section of...
2
by: Tyler | last post by:
I need to have a form that displays a group of 20 pictures in 4 rows of 5 pictures. The pictures are of people. Each Subject record has a picture field. I have a query written that selets the...
5
by: kenethlevine | last post by:
Hello I am fairly new to Access and am having a problem for which I am trying everything without success. It is access 2003. I have a main form. When the user presses a button a modal popup...
2
by: Steve | last post by:
I have a continuous form showing Product Code and Product Name. Product Code is five digits and is sequential. I have a textbox in the form header. What is the code to scroll the continuous form so...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.