Results 1 to 8 of 8
  1. #1
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085

    Lining up Tab Controls on a Form


    I have a data entry form in MS Access 2010. There is a Header Section that displays the Record data from the table the form is attached to. In the Detail Section There are 3 Tab Controls. With a total of 13 Tabs. The User Requested that they only scroll up and down not left to right so had to break up the tabs into 3 controls. The issue is that everytime the user clicks on one of the tabs the page changes and the tab name scrolls up where the user can't see it. Is there anyway to stop that?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Not sure, maybe have to resize the form.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Quote Originally Posted by June7 View Post
    Not sure, maybe have to resize the form.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    Here it is.
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I don't really understand the issue. When clicking on lower tab control, the upper one(s) have to scroll up.

    To avoid side to side scrolling with 1 tab control, should be able to set tabs for multi-row. Set the tab control Multi-Row property to Yes and UseThemes property to No.
    At first I got a horizontal scroll bar on the tab row, not multi-row tabs. Then I ran Compact & Repair and now I get multi-row tabs.

    The code for apiGetUserName and apiGetComputerName will error on Windows7 64-bit machines unless you use PtrSafe keyword.

    An alternative is the Environ() function.

    Environ("USERNAME")
    Environ("COMPUTERNAME")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    We don't have any 64 bit machines here and there are no plans to get any. We do use Windows 7 so I'll make that change just in case. Thanks. As for the original question. On the tab Control is it possible to make the tabs line up on the left side instead of on the top?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    No, that option is not available with tab control.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Didn't think so but had to ask

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by RayMilhon View Post

    ...The issue is that everytime the user clicks on one of the tabs the page changes and the tab name scrolls up where the user can't see it...
    I can't run 2010 files and so can't look at this, but frequently what you're describing is caused by two things.

    The first, as June7 suggested, is that you need to resize, either the Tabbed Control, or the Form, itself. Truth be told, most experienced developers will tell you that Forms that have to be scrolled, in either direction, are about as user-unfriendly as you can get!

    The second cause, in combination with a Form that has to be scrolled vertically, is that the first Control that gets Focus, when clicking on a given Tabbed Page, is located in the lower half of the Form. You can use the OnChange event Tabbed Control to set Focus to a Control near the top of the Page. Here's an example of code for the OnChange; just replace YourTabbedControlName and ControlNearTopName with your actual names for these Controls:

    Code:
    Private Sub YourTabbedControlName_Change()
     
       Select Case YourTabbedControlName 
      
        Case 0  'First Page 
          Me.ControlNearTopName.SetFocus
      
        Case 1  'Second page 
          'Code for Page 2 goes here
      
        Case 2   'Third page
          'Code for Page 3 goes here
      
      End Select
    
    End Sub

    This assumes that the Controls you mention are placed directly on the Tabbed Pages (as your description sounds) rather than on a Subform on the Tabbed Pages.

    Notice that the Index for Tabbed Pages is Zero-based; the first page is 0, the second page is 1, and so forth.

    If a Subform is involved, you'd first have to SetFocus to the Subform Control then use SetFocus for the Control, itself.

    Linq ;0)>

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

Similar Threads

  1. Enabling controls on a form
    By crowegreg in forum Programming
    Replies: 4
    Last Post: 08-22-2013, 09:18 AM
  2. Lining a pop form to parent form
    By IdleJack in forum Access
    Replies: 1
    Last Post: 09-19-2011, 12:19 PM
  3. Using Tab controls within a form
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 08-25-2011, 08:17 PM
  4. form Controls
    By dref in forum Forms
    Replies: 2
    Last Post: 07-22-2011, 03:31 PM
  5. Controls within form
    By crowegreg in forum Forms
    Replies: 4
    Last Post: 05-31-2011, 08:39 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