473,398 Members | 2,380 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,398 software developers and data experts.

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 16391

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
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
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
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
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
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
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
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
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
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
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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
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...

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.