Access 2003: Preventing mouse wheel scrolling records

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

Guest

Hi

I am trying to prevent the mouse wheel scroll through records in form view. I found an article on the knowledge base for Access 2000 (278379) but it han't worked for Acess 2003. Any ideas please

Thank you

Sue
 
See:
http://www.lebans.com/mousewheelonoff.htm
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

--

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


Sue said:
Hi,

I am trying to prevent the mouse wheel scroll through records in form
view. I found an article on the knowledge base for Access 2000 (278379)
but it han't worked for Acess 2003. Any ideas please?
 
Hi Stephe

Thanks for this. I have copied teh dll across and entered the code into the load event of my form - but my mouse (Logitech) is still scrolling - any ideas please

Thanks

Sue
 
Back it up a step. Have you tried the sample Forms to verify that the
DLL is copied to the correct folder and is functioning properly?

--

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


Sue said:
Hi Stephen

Thanks for this. I have copied teh dll across and entered the code
into the load event of my form - but my mouse (Logitech) is still
scrolling - any ideas please?
 
Can you copy and paste the code behind your form so I can have a look at
it?

--

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

I tried that dll file but it didn't work with me. I placed the dll file in the same directory where my mdb is, and I typed the following into the form code:
-------------------------

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

-------

Private Sub Form_Unload(Cancel As Integer)
' Turn the MouseWheel On
Dim blRet As Boolean
blRet = MouseWheelON

End Sub
-------------------------

that's all what I did. I wonder if I'm missing any thing.

Thanks for your help.
 
I've just tried and it worked wonderfully as "advertized" :) (thanks
Stephen!). I think most people missed out a step: importing the modMouseHook
module into their own database. Maybe Stephen would like to emphasize this
step in your doc.
ck
 
File | Get External Data | Import will let you import modules from another
database into the current one.

Another option is to open Stephen's database, find modMouseHook in it, open
it up, select everything then copy it. Then, open your database, go to the
Modules section, create a new module, paste everything you copied from
Stephen's database then save that new module.
 
Back
Top