Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Oct 2010
    Posts
    175

    Unanswered: How to Stop the scrolling between forms

    I have a form in which I have created that has the personal information for our agency's participants.

    When users are in the form viewing it, if they scroll down the page using their mouse, (more specifically the scroll button in the middle of the mouse), it jumps to a blank record which is set up as "autonumber". This can end up being confusing if users are viewing/editing information for a specific particiapant.

    How can I make the form more user friendly and get it to stop scrolling?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    consider settign the form properties
    so if they are only viewing data then set canedit property to false
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2010
    Posts
    175
    Okay I'll try it...but will that disable their ability to edit the form? I DO want my users to be able to edit information.

  4. #4
    Join Date
    Oct 2010
    Posts
    175
    I found that the property called, "on mouse wheel" can be edited to change this somehow. I'm wondering what VB code or macro I can use to NOT have the record change on mouse wheel.

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Yes, it will prevent editing of records.

    If you only need to have editing ability, you could set AllowAdditions to No, which would solve your problem and still allow editing.

    If you need the ability to add records, as well, you'll either have to, by default, set AllowEdits/AllowAdditions to No, then add a custom button to set AllowEdits/AllowAdditions to Yes, as needed, or you'll need to disable the mouse wheel.

    Disabling the mouse wheel can be done in pre-2007 versions using a third-party hack, or done in the form properties in 2007/2010.

    What version are you using?

    Linq ;0)>
    Hope this helps!

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

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Oct 2010
    Posts
    175
    The allowadditions property change did the trick, but users will need to have the ability to add new records.

    I would like to try the second or third options you suggested...but I'm not sure of how to go about this. Would I have to set both of those properties to "no"? And then what?

    I'm working with Access 2003.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    consider adding a button to add a record
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Oct 2010
    Posts
    175
    I do have this button.

  9. #9
    Join Date
    Oct 2010
    Posts
    175
    Well, something I did messed up my whole form...now it's not functioning.

  10. #10
    Join Date
    Oct 2010
    Posts
    51
    You can register this MouseWheel.dll. I think Access 2007 takes into account the scrolling, but .mdb and .adp files do not in Access 2003 and previous. According to Microsoft, it requires the Mousewheel.dll. If you don't trust mine, feel free to google MouseWheel.dll and obtain your own copy. All the source code is in the zip file too if you want to look at it.
    Attached Files Attached Files

  11. #11
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    If you're running Access 2007/2010, you already have a function that addresses this issue! Just check with Help.

    For all other versions, you'll need some outside help. A gentleman by the name of 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
    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.
    Last edited by Missinglinq; 12-07-10 at 17:55.
    Hope this helps!

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

    All posts/responses based on Access 2003/2007

  12. #12
    Join Date
    Oct 2010
    Posts
    175
    Okay I entered the code you suggested in the property of the main form that pops up for users under "on mouse wheel".

    I got the following error:

    The expression After Update you entered as the event property setting produced the following error: Ambiguous Name Detected: Form_Load.

  13. #13
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Ambiguous Name Detected: Form_Load

    would tend to suggest that you already have a Form_Load sub in the code behind your form. You need to find it and add the line

    blRet = MouseWheelOFF

    to it, and delete the

    Private Sub Form_Load()
    'Turn off Mouse Scroll
    blRet = MouseWheelOFF
    End Sub

    You can only have one copy of a given sub in the code module.
    Hope this helps!

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

    All posts/responses based on Access 2003/2007

  14. #14
    Join Date
    Apr 2011
    Posts
    2
    There is a property on the Form called "Cycle". Change this to "Current Record".

  15. #15
    Join Date
    Oct 2010
    Posts
    175
    Thanks NTK! You don't know how long I've been working on figuring that one out....seems so simple in hindsight!

    Thanks again! It worked like a dream.

Posting Permissions

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