Search code examples
formsms-access-2007relational-databasemousewheelsubforms

Mouse Scroll with 1 Main Form and 2 subforms MS ACCESS


I have a MS ACCESS 2007 form with 2 subforms. I have a few fields from the main form as text, a few on the second form as text, and a lot on the third form as a variety of things.

My problem with these subforms, when I am entering data in the main form, my mouse scroll works just fine to scroll to the bottom of the form. When I am in subform 1 or 2, my mouse scroll stops working to scroll down to the bottom of the main form. I tried looking up disabling mouse scrolling but that's already preset for a single form view in MS Access 2007. I just want the mouse scroll to work only for the general form even if you are doing data entry into subform 1 and 2.


Solution

  • I know it's been a while since your post. But I've had nearly the same problem and figured it out, so thought I'd post the answer anyway:

    If you make an extra textbox in your main form (make sure it's property visible is set to TRUE), then place this textbox behind any other control so to the user it seems like there is no textbox.

    Now in the properties of the details selection of the mainform make an onClick event (this occures when you click anywhere in the mainform). In this event use the SetFocus method which redirects to the textbox made earlier. The code looks like this:

    [Forms]![MAINFORM]!TEXTBOX.SetFocus

    If you click on the form (outside the subforms) the textbox gets selected automatically, which allows you to scroll the main form. The user doesn't see the textbox so it seems as if he/she selected the mainform.

    Hope it helped!