Scroll wheel beyond Leban's solution

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

in Access 2002/3 I have a tall form (50cm~20") and the users want to be able
to scroll down using the mousewheel. Many posts offers fixes that stop the
scroll wheel's default behaviour of cycling through the recordset. That is
not my problem. My problem is to move down the "page" (the form) using the
scroll wheel as the user advances through the questionaire.
I'm not sure it's relevant, but: the form in question contains a tab control
with a number of frames w. option buttons on each tab.
I've tried Leban's solution (http://www.lebans.com/mousewheelonoff.htm) -
but it does not provide the ability to USE the scroll wheel to - scroll the
form.
Any ideas?
 
I suppose you could use the MouseWHeel event and scroll the form
accordingly. The SetGetSb solution on my site contains code you could place
in the MouseWheel event to programmatically control the Veritical ScrollBar
window.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thanks Stephen, you're the man!

This code does the trick together with your API wrapper(fSetScrollBarPos):

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
Dim lngOldPos As Long, lngNewPos As Long, lngSpeed As Long
lngSpeed = 40 'Accelerator factor
lngOldPos = fGetScrollBarPos(Me)
If lngOldPos + (Count * lngSpeed) < 0 Then
lngNewPos = 1
Else
lngNewPos = lngOldPos + (Count * lngSpeed)
End If

fSetScrollBarPos Me, lngNewPos
End Sub
 
Correction:
If lngOldPos + (Count * lngSpeed) < 0 Then - should be:
If lngOldPos + (Count * lngSpeed) < 1 Then
since values below 1 sets the scrollbar to the bottom.
 
Glad you were able to develop a solution Ruben. I'm sure it will help the
next person who runs into the same issue.
:-)
--

Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top