Deactivate roller on Mouse, How???

C

castorsmith

(Access 1997)
Could anyone help me! I have a form called Companies, and
I use a combo box on the form header to search for the
companies, but if the roller on the mouse is touched the
form scans through all the 1660 records in the Table
Companies. How can I deactivate the roller on the mouse
or can i set the form some how that it does not recognise
the roller on the mouse or anything else. I am lost.


I would appreciate any help you can give me.


Thanks

Castor
 
S

Stephen Lebans

See:
http://www.lebans.com/mousewheelonoff.htm
New Version 2.7 March 24, 2004 This Page Viewed: times.

Please note this is an update from the March 09/04 release. Support has
now been added for Logitech Mice. The only difference between the
feature set for a MS Mouse and a Logitech Mouse is that you can scroll
an open Combo control from a MS Mouse only. Look at the code behind the
sample Forms to see how to turn the MouseWheel ON or Off. You need to
import into your own MDB the standard code module "modMouseHook" found
in the sample MDB included in the download zip file. Bug Fix for
SubForms with ScrollBars. Bug fix for SubForms without visible
ScrollBars. Added support to specify an optional Global versus thread
specific hook to allow for multiple instances of Access.

MouseWheelHook97.zip is an MDB demonstrating how to use a MouseHook to
turn off the MouseWheel. No more MouseWheel.DLL Hell! No DLL
registration required. The MouseHook DLL is a standard Windows DLL. Do
not try to Register it or set a Reference to it from within Access.
Just copy the included MouseHook.DLL into your Windows/System folder or
into the same folder as your application MDB. One instance handles all
Forms and SubForms so only call the functions once from a SINGLE Form.
Here is an A2K sample MDB including the DLL. MouseWheelHookA2K.zip .
Please note there is no difference between the MouseHook.DLL included in
either the A97 or A2K ZIP file.

Here is sample code that can be placed behind CommandButton controls.
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!

Private Sub Command14_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub

Or if you will be running multiple instances of Access then you can pass
an optional parameter to ask for a Global Hook. The default is FALSE.
Please note the Version documentation below.

blRet = MouseWheelOFF(True)


Private Sub Command16_Click()
' Turn the MouseWheel On
Dim blRet As Boolean
blRet = MouseWheelON
End Sub


--

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