Solved

Tab control - tabs not visible on subforms

Posted on 2006-07-07
15
626 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now