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

How to control the scrollbar of the subform

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a

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

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.

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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.