UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Scroll wheel on a form    
 
   
TimFPMD
post Apr 8 2009, 03:28 PM
Post #1

New Member
Posts: 10



I have several forms in a database that allow the user to select a record to display on the form by choosing a name in a combo box. The user can then read, add, delete, and edit the data on the form for that person. Unfortunately, some users have allowed their index finger to rest on the mouse scroll wheel, and have accidently scrolled from one name to another without realizing it - thus potentially changing the data for the wrong name! Any suggestions as to how I can prevent this? I have tried setting the "cycle" property for the form to "current record", but that doesn't prevent the problem...
Go to the top of the page
 
+
missinglinq
post Apr 8 2009, 03:33 PM
Post #2

UtterAccess Ruler
Posts: 2,655



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.
Go to the top of the page
 
+
Keaian
post Apr 8 2009, 03:34 PM
Post #3

UtterAccess Veteran
Posts: 323



hmm.. the cycle property didn't work? You set this on the form or subform bound by the cbobox?

I would check to make sure that the form itself has this property checked. I would be at a loss on to why it would still be happening if this was set to Cycle Current Record.

alternative. create a on mouse wheel event.

msgbox "Hey Capurnicus, Stop moving the mouse wheel",vbokonly

lol.. but that would just let them know they are messing with it.
Go to the top of the page
 
+
missinglinq
post Apr 8 2009, 03:40 PM
Post #4

UtterAccess Ruler
Posts: 2,655



The Cycle property doesn't prevent the mousewhheel from scrolling thru records. This problem has been around since the invention of the (mouse) wheel! Stephen Lebans solution has been the gold standard for years now in addressing the problem. Microsoft finally, in version 2007, addressed the issue and you can control it thru a form property setting.

Edited by: missinglinq on Wed Apr 8 16:41:34 EDT 2009.
Go to the top of the page
 
+
TimFPMD
post Apr 8 2009, 06:59 PM
Post #5

New Member
Posts: 10



Thanks, that did the trick!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 04:01 AM