Results 1 to 5 of 5
  1. #1
    aharown is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    10

    Mousewheel scroll in text box ... can't get it to work

    Everyone says this is asked alot, and I've several posts via googling, but they all error in various ways.



    Why you have to write code to make a text box do what it should by default is a question for another day, I guess, but for now, can anyone point me to a nice "assumes you know nothing" tutorial on how to make a text box scroll with a mousewheel?

    Many of the solutions I've found seem to say there is code that has to go in two different places. I managed to make a module a couple of times, following these recipes. Then went to Design on the form itself and hit the code button to put in some more code ... this was my best guess on where this code belongs.

    But lots of errors.

    I even downloaded one solution that was a sample database with a form that scrolls. His works. Tried to do it in mine: errors.

    So I'm missing something here. Probably just need more detailed instructions. Sure would be nice if the Poperty Sheet - Event tab had an "on mousehweel." But alas, no.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    His works. Tried to do it in mine: errors.
    perhaps provide the working example and your example for comparison? Otherwise no idea what you are missing or what you have tried.

  3. #3
    Minty is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    The reason it doesn't work is because Microsoft disabled it. So it is by design.
    There is a On Mouse Wheel property on the form event tab.

    This code works on a report embedded in a form
    Code:
      If Count > 0 Then
            SendKeys "{DOWN 2}"
        ElseIf Count < 0 Then
            SendKeys "{UP 2}"
        End If
    There are other variations.
    What happens when you click in the text box and scroll the mouse?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  5. #5
    aharown is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    10
    Minty's solution worked. For some reason, I couldn't find the onmousewheel event, so I was trying more complex solutions. Several claim to be 'better' because they don't use sendkeys, etc. But with the complexity came more opportunities to make rookie mistakes, with errors that don't yet mean anything useful to me.
    Anyway, all good now.
    Thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 08-31-2017, 04:16 PM
  2. Replies: 7
    Last Post: 09-02-2016, 03:47 PM
  3. text box scroll
    By Jen0dorf in forum Access
    Replies: 4
    Last Post: 02-11-2016, 01:55 PM
  4. Mousewheel Scroll Problems
    By n1nj4m4st3r in forum Access
    Replies: 4
    Last Post: 02-14-2014, 12:37 PM
  5. Mousewheel dll technique
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 04:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums