Cannot get MouseHook.dll working to completely disable mousewheel from scrolling records within Acce

S

sheree.hemphill

I would like to completely disable the mousewheel from scrolling
through records within an Access 2003 database form (there are many
forms within this database, all of which use tab controls, and all of
which I would like the mousewheel disabled).

I came across MouseHook.dll from the following url:
http://www.lebans.com/mousewheelonoff.htm

As suggested on that page, I placed a copy of the MouseHook.dll in the
same location as my access mdb file. I then placed the following code
in the form load event of one of my forms:

Private Sub Form_Load()
'TURN OFF MOUSE WHEEL:
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub

The form loads with no error, but when I use the mousewheel, it still
is actively scrolling through records (I don't want it to do anything
at all).

I initially tried in within the form load event of my Switchboard
form, since I ultimated would like it to carry through across all
forms used in this db, however, when that didn't seem to disable the
mousewheel, I moved it just into a specific form to see if I had any
better luck - unfortunately, it doesn't work in either location.

Any ideas on what I might be doing wrong?
 
S

Stephen Lebans

Did you import the standard code module from the sample MDB you downloaded
from my site?

--

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

sheree.hemphill

Thank you for responding!
I'm not sure I know what standard code module you mean. I have the
MouseHook.dll file and the sample code you show on your web page. I
copied the MouseHook.dll file into the same folder as the mdb file &
then I used the code you showed on your web page in my access db form
load event.
Is there another step that I'm missing? Or is there another file to
download?
 
S

sheree.hemphill

I had not previously viewed the sample mdb file. I do now see that
within it, there is a modMouseHook module. Is this what I need to get
this working? I didn't see any mention of this module on your web
page (I may have missed it).
 
S

sheree.hemphill

I had not previously viewed the sample mdb file. I do now see that
within it, there is a modMouseHook module. Is this what I need to get
this working? I didn't see any mention of this module on your web
page (I may have missed it).

I just tried exporting the modMouseHook module from your sample mdb
and then imported it into my mdb file. It still wasn't working. Then
I looked at the call you made within your sample code to turn off the
mousewheel -- it was different than what was shown on the web page.
It worked!!!

This code did not work for me:
Dim blRet As Boolean
blRet = MouseWheelOFF

This code did work for me:
Dim blRet As Boolean
blRet = MouseWheelOFF(True, False)

I also would like to know one more thing:
What is the best (safest) place to place the code to turn the
mousewheel back on? I want to make sure that no matter how they exit
the database, that the wheel is turned on again for other apps to use.

Thank you so much for helping me get this working!!
 
S

Stephen Lebans

Most Developers use a Hidden form to control Startup/Shutdown operations.

--

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