disabling mouse wheel on forms

L

lonecubga

I've got a fairly simple form which displays one record at a time
based on the primary key data selected in a combo drop down box. The
fields can be edited as necessary. I can't seem to disable the
mousewheel though. Once a field is selected, the mouse wheel will
scroll through each record, changing every field accordingly except
the primary key combo box. Any ideas on disabling this? It seems
very counter-intuitive to form management.
 
L

Linq Adams via AccessMonster.com

If you're running Access 2007, you already have a function that addresses
this issue! Just check with Help.

For all other versions, you'll need some outside help. A gentleman by the
name of Stephen Lebans has a sample database that does this and it can be
downloaded at:

http://www.lebans.com/mousewheelonoff.htm

First, download and unzip the db and take a look. Go into your db and goto
File > External Data > Import and import the module modMouseHook from the
sample database. Next make sure you have the included file, MouseHook.dll, in
the same folder your database resides in. The following code needs to run
before the mousewheel will be locked:

Private Sub Form_Load()
'Turn off Mouse Scroll
blRet = MouseWheelOFF
End Sub

If you have one form that always loads first in your db, place the code there.
If the first form to load varies, place the same code in each form.

You should be set now.
 

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

Similar Threads


Top