Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Disable Mouse Wheel?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Green - 24 Jan 2005 18:35 GMT
Access XP
Windows 2000

I'm looking for a way to disable the mousewheel when users are on a form, so
that scrolling the mousewheel does not change the active record. I found the
link belowat MS.com but am looking for something simpler - if I have to
install a DLL and register it on every machine that I need this
functionality on the fix is too complex and our users will undo it in my
absence.

Thanks in advance.
Tom - 24 Jan 2005 19:35 GMT
Try looking at:

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

Tom
> Access XP
> Windows 2000
[quoted text clipped - 9 lines]
>
> Thanks in advance.
anonymous@discussions.microsoft.com - 24 Jan 2005 19:36 GMT
tye Leban's mouse wheel fix
http://www.lebans.com/mousewheelonoff.htm

>-----Original Message-----
>Access XP
[quoted text clipped - 3 lines]
>that scrolling the mousewheel does not change the active record. I found the
>link belowat MS.com but am looking for something simpler -
if I have to
>install a DLL and register it on every machine that I need this
>functionality on the fix is too complex and our users will undo it in my
[quoted text clipped - 3 lines]
>
>.
DebbieG - 08 Feb 2005 05:33 GMT
This works for me in Access XP.  This works in Single Form, not Continuous
Forms.

HTH,
Debbie

Add a Text Box on your form:

Name = NoMouseWheel
Default Value = " "
Validation Rule = WheelSpin() = False
Validation Text = You can't change records using your mouse wheel. (this can
be left out if you don't want a message)
Visible = Yes
Enabled = Yes
Locked = No
Tab Stop = No
Back style = Transparent
Back Color = -2147483633 (or whatever color your form is)
Special Effect = Flat
Border style = Transparent

FORM EVENTS:

On Mouse Wheel:  [Event Procedure]
----------------------------------------------------------------------------------
Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
   On Error GoTo GotError
   mWheel = True
   ValidationTrigger = TheWheel
   Me.NoMouseWheel.SetFocus
   Me.NoMouseWheel.Text = " "

ExitSub:
   ValidationTrigger = NotTheWheel
   Exit Sub

GotError:
    MsgBox Err.Number & vbCrLf & Err.Description
    Resume ExitSub
End Sub
----------------------------------------------------------------------------------

On Error:  [Event Procedure]
----------------------------------------------------------------------------------
Private Sub Form_Error(DataErr As Integer, Response As Integer)
'    MsgBox DataErr

   If Screen.ActiveControl.Name = "NoMouseWheel" Then
       Response = acDataErrContinue
   End If
End Sub
----------------------------------------------------------------------------------

ADD THIS CODE BEHIND YOUR FORM:
----------------------------------------------------------------------------------
Option Compare Database
Option Explicit

'This Enum is for clarifying the code
Private Enum wsTrigger
   TheWheel = 1
   NotTheWheel = 2
End Enum

Private mWheel As Boolean
Private ValidationTrigger As wsTrigger

Private Function WheelSpin() As Integer
   'used in NoMouseWheel text box on form
   WheelSpin = mWheel
   Select Case ValidationTrigger
       Case NotTheWheel
           mWheel = False
   End Select
End Function
----------------------------------------------------------------------------------

| Access XP
| Windows 2000
[quoted text clipped - 7 lines]
|
| Thanks in advance.
Brandon Campbell - 29 Apr 2005 15:53 GMT
Debbie,

This almost works in other versions of Access. If the user is persistent
enough, and insists on scrolling the mouse wheel, the records will eventually
change. You do have to scroll a lot and most users will probably stop once
they don't see an immediate reaction on the screen. Anyway, this is a nice
clean way of performing the task at hand.

> This works for me in Access XP.  This works in Single Form, not Continuous
> Forms.
[quoted text clipped - 87 lines]
> |
> | Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.