Results 1 to 5 of 5
  1. #1
    Error404 is offline Novice
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    12

    Remove Scrolling in Subform (to stop scrolling difficulties in main form)

    Every time you make a subform, regardless of whether that subform has scrolling abilities at all (i.e. it is the optimal size), scrolling in the main form becomes tedious. You need to both A) make sure you are focused on the main form (i.e. have a field on the main form selected) and B) the mouse isn't hovering over a subform.

    Is there a way to force scrolling to always be in control of the main form? I could argue complex cases where you'd want scrolling to begin on the main form when it is exhausted in the subform, but I will live with a more simple solution for now.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I presume you mean scrolling by the mouse wheel and not form scroll bars? There are ways to disable the mouse wheel, and based on your post, I suspect you'd need to turn this on/off by calling the code from the sub form and main form. Not sure if you'd need the activate, focus, or current event for the forms. Here's a site that purports to have a faster, more reliable way to do this. Note: I have no affiliation with the site.
    http://www.everythingaccess.com/tuto...n-Access-forms
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Error404 is offline Novice
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    12
    Yes, I mean scrolling with the mousewheel. Scroll bars have nothing to do with my situation. I also worry that the solution you linked will cause the mousewheel to just 'die' once I hover over a subform (similar to what it does now, only more direct). What I want, is for the mousewheel to ALWAYS be linked to the main form, and completely ignore subforms by never attempting to scroll them. To iterate it again: when I scroll down, the main for scrolls down, when I scroll up, the main form scrolls up. ALWAYS.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I doubt you can do what you described, hence my suggestion to cycle it on/off depending on which form has the focus. If you succeed, it would be great if you posted your solution as I'm always up for learning something.
    Good luck!

  5. #5
    Error404 is offline Novice
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    12
    I have solved this issue using a 'ducktape' workaround. I'll document it for people who may wish to solve it the same way.

    What you can do is make the subform turn invisible when the user attempts to scroll in it:

    Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
    'Hides Subform when user attempts to scroll in it
    Me.Parent!DummyTextBox.SetFocus
    Me.Visible = False
    End Sub

    What this does is prevent access from locking your scrolling into that subform (because it is no longer visible). This unfortunately does not work if the form is not 'enabled' or 'locked'. Visibility seems to be the only option.

    The dummy textbox is a textbox in the main form that is so small it cannot be edited nor seen, it is simply used to prevent an error where access says "cannot hide a control that is currently in focus"

    in the parent forms code, have something like this:
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.AddressBook_subform.Visible = True
    End Sub


    What this does is make the form visible again. There are many ways to achieve this and I suggest you find the best way.

    I was thinking of surrounding the subform with smaller transparent box shapes that have this code in the 'OnMouseOver" event. Meaning that if you wave the mouse over the subform, it will reappear. Another solution would be a timer, have the form force the subform to be visible every second or something (please post how to do this if you know a method, I've never worked with timers). Try whatever works best.

    Here are some images.
    Click image for larger version. 

Name:	Fp01.jpg 
Views:	16 
Size:	257.0 KB 
ID:	23641

    Click image for larger version. 

Name:	Fp1.jpg 
Views:	15 
Size:	218.7 KB 
ID:	23639
    Click image for larger version. 

Name:	Fp2.jpg 
Views:	15 
Size:	266.1 KB 
ID:	23642


    If you ever discover a better way of achieving this result, please let me know.
    Last edited by Error404; 02-11-2016 at 11:28 AM. Reason: updated iamges

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

Similar Threads

  1. Replies: 1
    Last Post: 04-09-2013, 12:58 PM
  2. Stop Continuous Form Scrolling up
    By Deutz in forum Forms
    Replies: 4
    Last Post: 10-19-2011, 10:38 PM
  3. Subform scrolling is jumpy
    By kman42 in forum Forms
    Replies: 1
    Last Post: 07-27-2011, 01:36 PM
  4. Replies: 1
    Last Post: 02-08-2010, 06:22 PM
  5. Subform scrolling issue
    By Jerry8989 in forum Forms
    Replies: 4
    Last Post: 12-08-2009, 01:12 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