Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Tab control - tabs not visible on subforms

Posted on 2006-07-07
15
628 Views
Last Modified: 2008-02-20
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
Comment
Question by:libcat98
  • 4
  • 4
  • 2
  • +3
15 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17059145
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
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17059201
PS: Replace the subform/control names I used with your actual names.
0
 

Author Comment

by:libcat98
ID: 17059261
Sorry - I am new to VB.  Where do I put the code? I dont see any TabCtl1
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17059346
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
 
LVL 44

Accepted Solution

by:
GRayL earned 84 total points
ID: 17059594
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
 

Author Comment

by:libcat98
ID: 17059683
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
 
LVL 34

Expert Comment

by:jefftwilley
ID: 17060671
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
 

Author Comment

by:libcat98
ID: 17060850
No, it is the first field in the subform.
0
 
LVL 34

Assisted Solution

by:jefftwilley
jefftwilley earned 83 total points
ID: 17061129
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
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17063709
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 17105008
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
 

Author Comment

by:libcat98
ID: 17111779
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
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 83 total points
ID: 17112414
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
 
LVL 27

Expert Comment

by:jjafferr
ID: 17461756
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question