+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 24

Thread: Disabling Mouse Scroll

  1. #11
    Barn Newbie KenHigg is an unknown quantity at this point KenHigg's Avatar
    Join Date
    Jul 2008
    Posts
    6
    Rep Power
    4

    Quote Originally Posted by AOG123 View Post
    ..your sample doesn't really solve a great deal.
    Seems to work fine in the context in which it is applied - ?

    Quote Originally Posted by AOG123 View Post
    At this stage if the scroll is a problem you have 3 choices,. a modified mousewheel hock dll, the above example, or you simply develop the application under a better platform such as .net
    Actually, you seem to have overlooked my second choice, using a form that isn't bound to the table -

  2. #12
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    Quote Originally Posted by KenHigg View Post
    If you want to add new records(plural), why would you want to disable the scoll wheel to begin with?
    Well, I can think of several reasons..... first of all, say you wanted a form to give a timed test (say trivia, or IQ, or whatever), and every 20 seconds or so, it goes to the next record, well, you wouldn't want the person taking the quiz to be able to go back through and change answers using mouse scroll.

    Another example of why one would disable mouse-scroll...... say you have 2 sides to database entry...... The first side people start the record, and then the 2nd side people finish it up, based on first come first serve. Well, you wouldn't want people to be able to scroll through to the easy records leaving the hard records for everybody else. The 2nd side people would be entering new data perhaps into a subform.

    Yet another example, using single form method, and adding new records. Say you have a person receiving money as charity, he fills out a form with the donater's name, ssn, amount donated, and then when all info is correct, it prints a receipt, then it starts a new record. At the end of the day, you wouldn't want your data-entry clerk to view all of the social security numbers, nor would you want them to be able to change the donation amount. (Say they wanted to steal $100, they could mouse scroll and change the donated amount by $100)

    I could go on and on, but the main reason for locking out the mouse-scroll is for data integrity in one way or another. I mean, you wouldn't want a user to accidently scroll to another record while they think they're filling out a different record. Those are just some examples of why you would want to lock the mouse, and add new records at the same time.

  3. #13
    Barn Newbie KenHigg is an unknown quantity at this point KenHigg's Avatar
    Join Date
    Jul 2008
    Posts
    6
    Rep Power
    4

    I think we're getting into a pissing match.

    I never claimed it to be a cure all all though I'm sure I can devise a way to use the method that would address the concerns you've raised.

    Rather than be a burden to you all with my post I'll just delete it -

  4. #14
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    it's really not like that at all........ I was just trying to point out instances where making it data-entry and locking to one record, would not be enough. Obviously, most people won't have a use for disabling mouse scroll in the majority of their databases, but occassionally, there is a need.

  5. #15
    Barn Newbie kl99ny is an unknown quantity at this point kl99ny's Avatar
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    4

    AOG123,

    I was wondering if you could help me out here. I'm not a VB user and I have someone helping me with this.

    I have used what you paste on the mouse scroll lock and I have gotten two lines that are red. Could you please tell me what I am doing wrong...

    Code:
    Option Compare Database
    Option Explicit
    
    Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
        (ByVal hwnd As Long, _
        ByVal nIndex As Long, _
        ByVal dwNewLong As Long) As Long
    
    Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
        (ByVal lpPrevWndFunc As Long, _
         ByVal hwnd As Long, _
         ByVal msg As Long, _
         ByVal wParam As Long, _
         ByVal lParam As Long) As Long
         
    Public Const GWL_WNDPROC = -4
    Public Const WM_MouseWheel = &H20A
    Public lpPrevWndProc As Long
    Public CMouse As CMouseWheel
    
    I have copied and paste all 3 codes you have written into my VB script.

    Please advise.

    Thank you.

  6. #16
    Lightning Master AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123's Avatar
    Join Date
    Mar 2008
    Location
    Fortress Of Solitude
    Posts
    394
    Rep Power
    7

    Hi, and welcome to the forum,

    Have you downloaded the example? You find a zip file attachment at the bottom of this page DeveloperBarn Forums - View Single Post - Disabling Mouse Scroll

    You can import the modules from this attachment and see how the form events work.
    • 2 modules,

    Forms Events
    • Load,
    • Close and
    • MouseWheel_MouseWheel
    If i helped you, make me famous by clicking the

  7. #17
    Barn Newbie kl99ny is an unknown quantity at this point kl99ny's Avatar
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    4

    I have downloaded the .zip file. I have copied it to my code screen and I have gotten the two red lines. I guess something is missing there.

  8. #18
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Quote Originally Posted by kl99ny View Post
    I have downloaded the .zip file. I have copied it to my code screen and I have gotten the two red lines. I guess something is missing there.
    The two lines in red are just declaring public constants. Are you definining them somewhere else in your code? What happens if you change their names?

    Do you get any error messages? Stating that they are red doesn't help much.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  9. #19
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    What operating system are you using, and what version of Office?

    Can you post your entire VBA segement?

  10. #20
    Barn Newbie kl99ny is an unknown quantity at this point kl99ny's Avatar
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    4

    I want to thank everyone for their help. AOG123 is currently helping me with this. Thank you.

+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast

Bookmarks

Posting Permissions

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

SEO by vBSEO