Mouse Roller Ball??

spinkung

Registered User.
Local time
Today, 11:29
Joined
Dec 4, 2006
Messages
267
Hi All,

I have a form that is bound to a table. on the form i have an unbound combo box which, when changed (onchange event), sets the value of a text box which is bound the the forms bound table ID field.

The problem i have is that when i scroll with the mouses rollerball the text box ends up cycling through the ID records in my table. (the value in the text box changes)

How can i stop this so that you can't cycle through the records, only change the value in the text box by the combo selection???

Many Thanks,
Spin.
 
look for mousewheel on this site

there is a dll which will stop the mousewheel working

(at least it was working - for some reason it isnt working properly on my app at the moment)
 
thanks gemma.

will have a try at it and see what happens. :)
 
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:

Code:
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.
 
Isn't this a "focus" problem? Whichever object/control has the focus is going to react to the roller ball. Won't moving the focus stop your problem? I think it's a bit drastic (or early yet) to start looking at rollerball dll's and disablement?
 
The mouse wheel is basically PageUp or PageDown. So if it's not disabled, it will scroll through the records as if you were using the PageUP or PageDown keys.
 
As Scooterbug suggested, it has nothing to do with which control has focus. It's just that the OP was looking at the ID textbox when he noticed that moving the rollerball or wheel caused Access to scroll thru the IDs.
 
Just a minor change to the example code. Instead of:

blRet = MouseWheelOFF

it has to be:

blRet = modMouseHook.MouseWheelOFF

You have to reference the Module name...
 

Users who are viewing this thread

Back
Top Bottom