473,714 Members | 3,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 15406
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******@usato day.com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.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.Records etclone
rst.findfirst "IDField = " & KeyToFind
Me("SubFOrmName ").Form.BookMar k = 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
9366
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 clause after users typed in one or several letters/digits. My problem is as follows Most of the time I need to display form in continuous format, that means the combo box will appear in each record. For example I have a form to let users view...
3
7917
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 the other records in the list? Thank you in advance, Mark
5
5258
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 box that is populated with the code =subfrm_media_review_sec_party.Form!first_name & " " & subfrm_media_review_sec_party.Form!last_name It works except that when I flip through the names it populates the parent form with the name of what ever...
3
4659
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 size version of each photograph horizontally across the form, then have the photgraphs "word wrap" (picture wrap ?) at the right end of the form onto the next "line" of photographs. Does anyone know how this can be done? Obviously, displaying...
1
4781
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 item is a panel, with a specific texture. There are standard panels that are then produced in a limited number of specific textures. The number of panels/project varies, so I keep track of the actual number of panels per project with the count:...
2
2336
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 the scrollbar can be clicked to show the record again but this is hardly intuitive to the user. Any help is appreciated.
2
2982
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 group of records I want. Now I could use some help displaying just the pictures on a form in a 4 rows of 5 pattern. I don't want to have a continuous form with 20 pictures in a row. (although if that were the case I would have finished already). The...
5
6028
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 comes up with a continuous form based on a database table. I am manually linking the table to the main form table rather than as a subform, but either way I get this problem. When the popup comes up, even though there are 3 records, I only see one. ...
2
4447
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 that as I type in the the first two or three numbers of the product code in the textbox, the first product code record appears at the top of the form. I would like the continuous form to act like a combox with auto expand. Thanks!
0
9316
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9077
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5959
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4729
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3160
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2525
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.