Scrollbar value (1 Viewer)

rockman

Senior Member
Local time
Yesterday, 21:08
Joined
May 29, 2002
Messages
190
Is it possible to determine where the scrollbar slidebar is located at any particular time.

This is what I'm looking for:

If slidebar is at the top of the scrollbar...
form.scrollbar = 0

If slidebar is at the bottom of the scrollbar...
form.scrollbar = 1000

If slidebar is exactly in the middle of the scrollbar...
form.scrollbar = 500

Thanks,
Jeff
 

boblarson

Smeghead
Local time
Yesterday, 21:08
Joined
Jan 12, 2001
Messages
32,059
If you have a scrollbar with the name: scrScroll1

Then you can find the value by using scrScroll1.Value

You can then do conditional stuff like:

Select Case scrScroll1

Case <=500
txtMyTextBox = "Not quite enough"

Case >500 AND <750
txtMyTextBox = "Fair"

Case >750
txtMyTextBox = "Great Work"

End Select
 

rockman

Senior Member
Local time
Yesterday, 21:08
Joined
May 29, 2002
Messages
190
Thanks for the reply Bob.

The scroll bar that I am referring to is not my own ActiveX control (in which case your answer would be very appropriate), instead I am referring to the scroll bars that Access itself supplies.

I had a bit of a break-through (very small break-through) last night when working with the GetWindowPos API. Seems that the NormalPosition parameter will return a negative number if the form is scrolled off the top.

More troubling is the fact that I need to know the scroll value of a subform! Does a subform even have an hWnd property?

Any leads would be most appreciated,
Jeff
 

Users who are viewing this thread

Top Bottom