Results 1 to 4 of 4
  1. #1
    pgruenke is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2018
    Posts
    9

    Scroll bar for form in sub-container


    I have a main form that contains three tabs, each of which controls a form appearing in the sub-container. I dropped a page break onto the first sub-container form so that I could have a scroll bar available (form is 17" long). Works perfectly as long as I am just entering data. But if I omit a required piece of data the pop up appears telling me I must enter the data. When I close the pop up and enter the data, I loose all control of the sub-container form, which automatically jumps to the top of the sub-form. This becomes a major pain especially if more than one required data is omitted. How can I retain control of the form?

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,121
    For any other control, you could check if DCount=0 & if so, disable the control
    Unfortunately the page break control is unique in that it can't be hidden or disabled

    So I think you need to do one of the following:
    a) devise some other method of forcing a scroll bar
    b) check for the required data item and enter it automatically if feasible thus preventing the popup
    c) remove the required status for that field
    d) redesign your form layout to break in a different way

    I suspect you will say none of those are a satisfactory outcome
    Without seeing your report its difficult to come up with a solution you are likely to be happy with
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    pgruenke is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2018
    Posts
    9
    Colin, I would be ecstatic with your "a". Is there another way to force a scroll bar when the form is in a sub-container? "b" and "c" aren't possible. Its a form, not a report, and the only reason I have the page break is to force the scroll bar.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,121
    I meant form - no idea why I wrote report - I've corrected it now
    As you realise, scroll bars only appear when a control has focus
    Can you add code to reset the focus back to the 'sub-container' after entering the data?
    Assuming the focus is in the form (or subform) containing your 'sub-container'
    Code:
    Me.SubFormName.SetFocus
    or if it's a textbox in the subform
    Code:
    Me.SubFormName.Form.TextboxName.SetFocus
    If its in another subform, then you'll need more complex code .
    Something like:
    Code:
    Parent.SubFormName.Form.TextboxName.SetFocus
    See this link for more info http://allenbrowne.com/casu-04.html

    Also this thread may have something useful - similar idea in some ways:
    https://www.access-programmers.co.uk...+without+focus

    Good luck
    I'm signing out now.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 7
    Last Post: 09-02-2016, 03:47 PM
  2. Replies: 2
    Last Post: 09-10-2015, 03:21 PM
  3. Custom Collection: String Container
    By drexasaurus in forum Code Repository
    Replies: 0
    Last Post: 12-15-2014, 03:57 PM
  4. Error referencing filter property of a sub-form container
    By GraeagleBill in forum Programming
    Replies: 4
    Last Post: 03-23-2014, 01:14 PM
  5. Replies: 2
    Last Post: 04-13-2011, 09:42 AM

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