Results 1 to 8 of 8
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    233

    Unanswered: De activate Mouse wheel

    Is there a way to de-activate the mouse wheel for the whole program. I dont have time to do it for each form so ideally when the users logs on to run some code that will deactivate until they log off.

    Ta,
    Rob

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I haven't come across anything which disables the mousewheel for the entire mdb (all forms). The mousewheel.dll example in the code bank still entails writing code within each form to disable it for that specific form. (I stopped using the mousewheel.dll file since it's easier to just put code in the OnCurrent event of the form (ie. docmd.gotorecord,,acfirst - no mousewheel.dll involved). But the form then needs to be opened based on a single record.

    I hope someone eventually finds code which would disable it completely for all forms within an mdb. As of now, I haven't seen any code to do this but you can of course, disable the the mousewheel via the control panel but this will disable it for everything (ie. all programs.)
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Stephen Lebans has a sample database that does this and it can be downloaded at:

    MouseWheelOnOff

    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
    You'll need to run this when you first open your database, and all forms will be covered unless you explicitly turn the wheel back on.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by pkstormy View Post
    As your example shows (ie. Form_Load), you still need to put code in EACH form.
    Haven't worked with split databases that much, but you only need to include the code I gave in a single form, assuming you have a form that always loads first. After that it locks the wheel in all forms.

    I always have a splash form set to load when the db opens, and that's where I place the code. Been using it this way for a number of years, now.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Missinglinq,

    I deleted that post since I believe I was incorrect (but see you had already copied my quote). I still think there's something you need to do. But perhaps you are right. It's been a while and I sincerely apologize for my pre-assumption!

    I just had too many problems and gave up using the dll file (with different environments). But shame on me for speaking out of turn and too soon (I should know better.)

    Please accept my apology.

    Here's the link to the code bank: http://www.dbforums.com/6303048-post52.html

    It has Lebans example as well as another but your link should be used for the latest.
    Last edited by pkstormy; 11-27-09 at 19:06.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    The only thing that I ever had a problem with was the location of the DLL file. Sometimes it would work regardless of where it resided on the hard drive, and sometimes it wouldn't. This was totally resolved by always making sure a copy resided in the same folder as the db.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I've deleted all my posts where I gave wrong info. Again, please accept my apology. I spoke out of turn and incorrectly.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    No problem!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •