MouseWheelHookA2K question

  • Thread starter Thread starter GDW
  • Start date Start date
G

GDW

Here's an excerpt from http://www.lebans.com/mousewheelonoff.htm:
==================================================
You could also place this code in the Load event of a single Form.
Remember you need to call these functions only ONE TIME. The MouseHook
will look after the MouseWheel messages for all forms that you have
open now or at any time during your current session. Remember to turn
the MouseWheel back on before you exit the current session!
==================================================

Where do you turn the MouseWheel back on before you exit the current
session? What exactly is a "session" in Access and are there events
associated with starting/stopping a session?

Thanks!
Gary
 
Stephen's sample database clearly shows that you "turn off" the wheel in a
form's Load event, and "turn on" the wheel in that form's Unload event.
 
Hi Ken,

Per the following excerpt from Stephen's site:

" Remember you need to call these functions only ONE TIME. The
MouseHook
will look after the MouseWheel messages for all forms that you have
open now or at any time during your current session."

the code does not appear to be form-specific at all but is functional
for all forms in a given "session" (I'm guessing that that means while
you have the database open). So if you turn it on in a form's Unload
event and there is another form open that has also turned it off in its
Load event, the form that is still open will now have wheel
functionality turned back on. The ideal way to avoid this conflict is
obviously to turn it on and off only one time per application. That
brings us back to my original question of whether there are events
associated with starting and stopping an Access application.

Gary

<MCSD, MCDBA, MCSE>
 
You'll need to open a hidden form when ACCESS first starts. Use that form's
Load and Unload events to turn off and on the mousewheel.
When you close ACCESS, the hidden form also will be closed.
 
Forgot to say that you can have this form open automatically be setting the
Startup options (in Tools menu) to open this form as the first form when the
database opens. This form then should call your switchboard form or whatever
menu form you want the user to see first.
 
Back
Top