Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 636
  • Last Modified:

Tab control - tabs not visible on subforms

I have a Main form & two subforms. I am using the tab control to navigate from the main form to the subforms.

When the main form loads,the tabs at the top of the page are visible, however when I go to the subforms the tabs are no longer visible. They are there at the top of the page, but disappear due to the scrolling of the form. How can I fix it so that the tabs are visible of the subforms too?
0
libcat98
Asked:
libcat98
  • 4
  • 4
  • 2
  • +3
3 Solutions
 
puppydogbuddyCommented:
Try this:

Private Sub TabCtl1_Change()
On Error GoTo Error_Routine

'commits any changes
If Me.Dirty Then Me.Dirty = False

Select Case Me.TabCtl1.Value
    Case Is = 0   'run code for page1...(Me.Page1.PageIndex = 0)
        Me!Subform1.Visible = True
        TabCtl1.Pages.Item(0).SetFocus
    Case Is = 1   'run code for page2......(Me.Page2.PageIndex = 1)
        Me!Subform2.Visible = True
        TabCtl1.Pages.Item(1).SetFocus
     Case Else
        '.......................................
End Select
Exit_Continue:
        Exit Sub
Error_Routine:
        MsgBox "Error# " & Err.Number & " " & Err.Description
        Resume Exit_Continue

End Sub
0
 
puppydogbuddyCommented:
PS: Replace the subform/control names I used with your actual names.
0
 
libcat98Author Commented:
Sorry - I am new to VB.  Where do I put the code? I dont see any TabCtl1
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
puppydogbuddyCommented:
It goes in the change event of your tab control.  As stated, you have to use the actual names of your subforms and tab control in place of the names I used.  I have no way of knowing what your actual names are.
0
 
GRayLCommented:
That is very unusual behavior for forms. Running A2K, I have a form with 4 pages in the tab control, a couple of comboboxes and a subform on each page, the subform is a scrollable recordset, and sized so that is fits below the other controls and tabs.  Scrolling has no effect on the visibility of the other controls and the tabs when the form is run.  Are you sure you have not made the subform just too big in height?  If you are embedding a form as a subform, make sure the size of the original form will fit into the space available for the subform.
0
 
libcat98Author Commented:
I am running Access 2003 - The form is not too big, but I think this may have to do with the focus being set on a particular field, Could that be causing the scrolling ?  
0
 
jefftwilleyCommented:
is the field in question far enough down on the page of the subform to require you to scroll down to get to it? If so, then definately.
0
 
libcat98Author Commented:
No, it is the first field in the subform.
0
 
jefftwilleyCommented:
you're going to have to decrease the height of your subform to fit on a screen size page of your main form. Odd thing is that you're not having to scroll down the main form to get to the subform scroll bar? Try making your subforms less tall, then shrink your main form to screen size (height wise), so that you will see the whole main form.
J
0
 
puppydogbuddyCommented:
Make sure your tabs have not been "turned off".  Click on the tab control at the top perimeter between the tabs and the main form. bring up the "property" sheet for the Tab control, go to the "Style" property.   The tab style has three options....you can select tabs, buttons or nothing!  Make sure "tabs" has been selected
0
 
Jeffrey CoachmanCommented:
libcat98,

I agree with all of the others... sounds like a "size" problem.

If not, then perhaps there is some confusion in the terminology:

So, technically, what do you mean by:
<due to the scrolling of the form>
<Could that be causing the scrolling >

How do you define "scrolling"
(Left/ Right, Up/Down, or something else altogether)?

When the tabs "disappear", how do you get them back?

There is nothing in a form that would cause it to "scroll" just by clicking on a field.



You could simply try recreating the form and see if the problem still exists.

Also, try a "Repaint" on the "enter" event of the control in question.

Sub YourSubFormField_Enter()
    Me.Repaint
End Sub

This code simply "Redraws" the from.

Hope this helps as well.
0
 
libcat98Author Commented:
The tabs do not techically diappear - the remain hidden at the top of thepage. You have to use the scroll on the right side of the page to access them.   I recreated the form, and the moved the tabslower on the page. It still does this - but to a lesser,acceptable extent.    
0
 
Jeffrey CoachmanCommented:
OK,

I was able to simulate this behavior when the two subforms were at different heights *inside* the tabbed control, relative to the Main form, AND the *from* is restored (not maximized)
For example the main form is 5 wide and 4 tall
The tabbed control's upper left corner is at 1,1
The tabbed control is 4 wide by 3 tall
Subfrom 1 is on the first tab, it is in the upper left hand side of the Tab.
Subform 2 is on the second tab, but it is an 1.5 "lower" in the tabbed control than the first sub form.

Now, When the form is restored and you click on the first tab, all is fine.

However, when you click in the second tab, the form "Jumps Down" so you can see the other (lower) subform.
This causes the tabs to "scroll" out of view.
 
Is this what you have?

If so, then you will have to redesign your form so that all of the controls are visible and the form is maximized.
So this "scrolling" will not occur.

Hope this helps!
:)

If not, you will have to post two "full screen" screen shots here:
One "before" the scrolling.
And another "after" the scrolling.
0
 
jjafferrCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Split: GRayL {http:#17059594} & jefftwilley {http:#17061129} & boag2000 {http:#17112414}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

jjafferr
EE Cleanup Volunteer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 4
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now