Results 1 to 12 of 12
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Form scrolls down hiding header

    I have an app that looks pretty good on the 24" monitor I use. I think it would look good on most monitors,


    but I've had trouble squeezing the forms on laptop screen that looks about 16". I've squeeze these forms about as much as I can,
    but I am having trouble getting my subforms on a tabbed control to behave. Here are some examples.

    The app opens up to the first page of a tabbed control. As you can see the parent form is scrolled down hiding title, information about the data and page tabs.
    Click image for larger version. 

Name:	Form Scrolling 1.JPG 
Views:	27 
Size:	19.4 KB 
ID:	42724

    When its scrolled up it looks like this.
    Click image for larger version. 

Name:	Form Scrolling 2.JPG 
Views:	27 
Size:	30.8 KB 
ID:	42725

    Page 4 works correctly some of the time. If I click around some it eventually scrolls down too.
    Click image for larger version. 

Name:	Form Scrolling 4.JPG 
Views:	27 
Size:	31.5 KB 
ID:	42726

    Page 5 never scrolls down.

    I don't mind the user having to scroll down to see the rest of the form, but I always want them to the top of the form along with the page tabs.

    Any thoughts?

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    See this article about automatic form resizing on my website http://www.mendipdatasystems.co.uk/a...g-1/4594554784
    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
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    Sounds to me like the problem is the control tab order when it opens; i.e. some control near the bottom has the focus, which can make the form scroll down. However I'd expect it to be always the case if we're talking about when the form opens. You seem to be saying it's a sometimes thing. Not sure that form resizing is related to why your form scrolls down, although you might really have 2 issues.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Colin,

    I will definitely look into this for future apps.

  5. #5
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Micron

    I suspected that focus was the problem and so I created a microscopic text box at the top of the form to move the focus to.
    Finding the right event was challenging and why it worked in some cases, but not in others.
    After a lot of trial and error I determined the On Enter event in the subform on each page would do the trick. I put

    Code:
    Private Sub subfrmImport_Enter()    
    
          Me.txtSetFocus.SetFocus
    
    End Sub
    in each subforms OnEnter event and it worked. I know it's a hack, but I can live with it.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    Well, if you're not satisfied with that I suppose you could upload a file copy, otherwise you're welcome.

  7. #7
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Turns out I am unsatisfied. I fixed the scroll down problem, but broke everything else. As long as the Me.txtSetFocus.SetFocus was in the On Enter event of the subform, none of the command buttons work. Take that out and everything works, except the scroll down problem returns.

    I'll upload a shell copy you can look at. I've left the On Enter events in place, but commented out the code. You'll have to hold down the shift key to bypass the startup options.
    Attached Files Attached Files

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    I think your problem is stems mainly from design, although that doesn't mean that if you fix what I think is the major issue that there won't be other issues. In the case of a tab control, the largest page is going to dictate the height of the control. The page size is going to be dictated by the size of any nested controls you have on it, such as subforms. The forms are the only things that can have scrollbars, so their vertical position is often at the top of the form (as long as control focus hasn't been set somewhere that prevents this). However, your largest page is really tall, so the tab control is really tall, thus any form on any page that is displayed is trying to center the page, and that causes your main form to scroll into a position that allows that page to be centered. I think you'll have to redesign the forms on one or more pages so that all pages fit in your main form real estate in such a way that doesn't cause your main form to scroll.

    EDIT - took a quick look to see what I might do if this was my form and realized I really don't know how this db is used. One supposition I made is that all of those buttons open reports (or maybe some open forms) that relate to some thing that you've encapsulated in boxes/frames. If TOC frame's 6 buttons are all for some type of report in a grouping, then why not use a combo with 6 list options? Then it takes up the space of one combo. Or use a multi select listbox if you think that being able to run 2 or more reports in one go would be a useful option. The real problem may not be the size/placement of controls on a form on a page - it might be that you're using too many for what could be a simpler and more concise approach; one that might eliminate a bunch of code in the process.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I will try not to jinx this, but I have found a solution that works, mostly (fingers crossed). I replaced txtSetFocus with txtTabStop_0 which I set it as such. and that seems to have done the trick. The top of the form stays viewable no matter where I click. Except if I hit the tab key which sets the focus elsewhere. Even though I have set all the other possible tab stops to No, they still show up in my tab order window. Is there something I am not doing?

    This is not a show stopper. I am willing to ship as is if I have to.

    CCS3 Data Quality Tools 3.5.3.0 20201021 Access Forums.zip

  10. #10
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Paul

    You might want to take a look at the tab order of the controls on each page of the tab control. the focus seems to jump about all over the place
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    On my phone so can't download right now. If the last post doesn't help consider that other things like subforms can take the focus. When testing your first db I was able to return what the active control was in the immediate window but I forgot the syntax. Probably not Screen.ActiveControl as I think that's no good because the editor is the active screen. Figure that out and you'll find out if it's a form or not.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    As of right now the screen only rolls down if they hit Tab AFTER clicking on the tab control. The good news is when they scroll back up, it stays that way until they hit Tab again. So unless they are hitting Tab all the time this really isn't a problem.

    Bob/Micron, I went through the entire form and subforms and set tab stop to NO on every control I could find. That might have help, but what sealed the deal is what I did next.

    Edit:
    I added one more line of code that I didn't expect to do anything, to my surprise it made all the difference. The form no longer scrolls up and all the controls are working.
    I hope not to bother you again with this, at least this weekend.

    Code:
    Private Sub tabDataQualityTools_Click()
    
        Me.txtTabStop_0.SetFocus
    
    End Sub

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

Similar Threads

  1. Replies: 3
    Last Post: 12-01-2017, 12:52 PM
  2. Replies: 3
    Last Post: 12-17-2013, 10:10 PM
  3. Listbox scrolls too far to right
    By jsunnb in forum Forms
    Replies: 3
    Last Post: 07-12-2013, 11:19 AM
  4. Replies: 1
    Last Post: 05-23-2012, 01:32 PM
  5. report text scrolls away when try to C & P
    By noniknonik in forum Access
    Replies: 0
    Last Post: 06-09-2009, 07:04 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