Another Mouse Wheel Problem

G

Guest

I have inserted Leban's code to disable mouse scrolling into the forms
"OnOpen", "OnGotFocus", "OnActivate" and "OnPrettyMuchEverythingElse"...and
it works.

HOWEVER, as soon as I use a command button (Previous Record, Next Record,
Create New Record, etc.) the mouse scroll is reactivated. If I enable the
record navigators on the bottom of the form, and use those to navigate, the
mouse scroll stays inactive.

Is there some other code I need to add to my command buttons? (I would
really like to keep them on the form instead of the record navigators)

This is the code I used:
Private Sub xxxxxxxxxxxx
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF(False)
End Sub
 
G

Guest

OK...after messing around with this a bit more, I think I'll just keep it the
way it is. I've placed the code in the OnOpen event procedure. After
selecting a navigation command button, I'm able to scroll records with the
mouse wheel. But, as soon as I select a field in the form, the mouse wheel
is again deactivated. This will work, but I'm open to more suggestions.
Thanks.
 
S

Stephen Lebans

As per the sample code on the MouseWHeel Web page and in the forms
contained within the sample MDB, you are to use a SINGLE Form's Load an
Unload events to start and stop the MouseWheel...period. Any other
behaviour is not supported.

There are only two situations in which the MouseWheel will still scroll
with the MouseWHeel hook activated.

1) On a Subform and this is by design. Send me an EMail if you want a
newer version of the DLL that contains an optional parameter in the
MouseWheelOff function to disable the MouseWHeel completely for
SubForms.

2) If you have a Form that has the Close Button property DISABLED.
--

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top