473,486 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to control the scrollbar of the subform

Dear all,

Can one control the subform scrollbar through vba?

For example, I would like to make two command buttons on the main form to
control the subform scrollbar. Click 1st button the subform vertical
scrollbar goes down to the end, click 2nd button goes up to the top
position.

Thank you for your help,

Paul


Nov 13 '05 #1
4 16408

Paul T. RONG <et***@hotmail.com> wrote in message
news:fY******************@news.chello.at...
Dear all,

Can one control the subform scrollbar through vba?

For example, I would like to make two command buttons on the main form to
control the subform scrollbar. Click 1st button the subform vertical
scrollbar goes down to the end, click 2nd button goes up to the top
position.

Thank you for your help,

Paul


Something like this should get you going if you create a command button and put
this
in the on click event
You need to change the subform name to suit
Go to last record use - acLast
Me.Reservations_Subform.SetFocus
DoCmd.GoToRecord , , acFirst

HTH
David B

Nov 13 '05 #2
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.

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.
"Paul T. RONG" <et***@hotmail.com> wrote in message
news:fY******************@news.chello.at...
Dear all,

Can one control the subform scrollbar through vba?

For example, I would like to make two command buttons on the main form to control the subform scrollbar. Click 1st button the subform vertical
scrollbar goes down to the end, click 2nd button goes up to the top
position.

Thank you for your help,

Paul


Nov 13 '05 #3
Thank you Steve,

The SetGetSB is a great work, but the codes are just too difficult for me.
And I realized that I have another hard nut to crack (see another post of
mine "help! subform vertical scrollbar problem").

regards,

Paul

"Stephen Lebans" <Fo****************************************@linval id.com>
??????:an**********************@ursa-nb00s0.nbnet.nb.ca...
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.

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.
"Paul T. RONG" <et***@hotmail.com> wrote in message
news:fY******************@news.chello.at...
Dear all,

Can one control the subform scrollbar through vba?

For example, I would like to make two command buttons on the main form

to
control the subform scrollbar. Click 1st button the subform vertical
scrollbar goes down to the end, click 2nd button goes up to the top
position.

Thank you for your help,

Paul

Nov 13 '05 #4
David,

I think I didn't make me understood. I would like to move the subform scroll
bar without changing the focus on a certain record. But maybe I am wrong.
Thank you for your help.

Paul

"David" <Da***@hoofprintnospam.fsnet.co.uk>
??????:cp**********@newsg3.svr.pol.co.uk...

Paul T. RONG <et***@hotmail.com> wrote in message
news:fY******************@news.chello.at...
Dear all,

Can one control the subform scrollbar through vba?

For example, I would like to make two command buttons on the main form to control the subform scrollbar. Click 1st button the subform vertical
scrollbar goes down to the end, click 2nd button goes up to the top
position.

Thank you for your help,

Paul

Something like this should get you going if you create a command button

and put this
in the on click event
You need to change the subform name to suit
Go to last record use - acLast
Me.Reservations_Subform.SetFocus
DoCmd.GoToRecord , , acFirst

HTH
David B

Nov 13 '05 #5

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

Similar topics

1
3277
by: David B | last post by:
I have a sub form in datasheet view on a form. I want a query to find the recordid every time a different row on the datasheet has the focus. The query is grabbing data for a combo on a second sub...
2
3295
by: Cameron | last post by:
Hi, For the database I am currently working on, my employer would like the ability to use multiple combo boxes in order to filter the database. For instance the structure of the company is based...
3
4125
by: Joshua Ammann | last post by:
Hi, (Using Access 2000) I have two tables, similar to Customers and Orders. (Not an exact parallel, but works for this example.) On a form showing customer data, there is a tab control. One...
7
6476
by: kevin.jonas | last post by:
Let say I have a form called "frmMachineSpecs" witht wo subforms, "frmSpecs" and "frmMachines". Both subforms are in datasheet view. The first control in "frmSpecs" is "txtOEM_No". I want to...
3
1824
by: Kranman | last post by:
Hi All, Love this site, have gotten a lot from it. This is my first time posting though, so forgive me for any errors. I have an Access 2000 db where I have a main form of Contractors and on...
1
3060
by: RzB | last post by:
In a previous post in this NG (Oct 98) http://makeashorterlink.com/?D505347FB Henry Craven says that he was investigating a relationship between the presence or absence of a "Me!" prefix, the...
1
1741
by: qhimq | last post by:
Hi, I have a lot of edit child windows and text painted on a windows application made from the API all at runtime. How do I go about making the scrollbar to move them all? What I attempted: ...
4
2438
beacon
by: beacon | last post by:
Hi everybody, I have a form (frmDeficiency) with a tab control (called deficiencyTabControl) that has 8 tabs. The first tab is for general information, but the 2nd through the 8th tabs have a...
1
1968
by: Cornishgamehen | last post by:
Hi, I seem to have discovered a bug/problematic feature in Access 2002. When navigating through records in a form, if a control in one of the subforms has the focus, and that subform becomes...
1
2877
by: lvmoore | last post by:
I have the calculation located in the footer of the subform. There is sometimes no rows in this form so I have used Allen Browne's IIF(FormHasData(),calculation,0) syntax to show a zero if there...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
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,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
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...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3069
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...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
0
262
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...

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.