473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hide/Unhide Tabs

19
I have a database built on 4 tabs, but inside one of those tabs I would like another group of tabs. The problem is that my second group of tabs are being displayed on ALL of the main 4 tabs and not the single tab that I would like it to. What I am asking is if anyone knows of a code that would only make my second group of tabs visible when only 1 of the 4 main tabs is clicked, and when the other 3 main tabs are clicked, the second group of tabs are NOT visible.

Here is a more visual look at the database.

http://www.geocities.com/database4242/database3.JPG

Thank you
Aug 9 '07 #1
5 19121
puppydogbuddy
1,923 Expert 1GB
I have a database built on 4 tabs, but inside one of those tabs I would like another group of tabs. The problem is that my second group of tabs are being displayed on ALL of the main 4 tabs and not the single tab that I would like it to. What I am asking is if anyone knows of a code that would only make my second group of tabs visible when only 1 of the 4 main tabs is clicked, and when the other 3 main tabs are clicked, the second group of tabs are NOT visible.

Here is a more visual look at the database.

http://www.geocities.com/database4242/database3.JPG

Thank you
Expand|Select|Wrap|Line Numbers
  1. Try invoking your code on the change event of the tab control on the main form, something like this:
  2.  
  3. Private Sub TabCtl1_Change()
  4. On Error GoTo Error_Routine
  5.  
  6. 'commits any changes
  7. If Me.Dirty Then Me.Dirty = False
  8. Select Case Me.TabCtl1.Value
  9.     Case Is = 0  
  10.         'run code for page1<Me.Page1.PageIndex = 0>
  11.         TabCtl1.Pages.Item(0).Visible = True
  12.     Case Is = 1
  13.        'run code for page2<Me.Page2.PageIndex = 1>
  14.         TabCtl1.Pages.Item(1).Visible = True
  15.         TabCtl1.Pages.Item(1).SetFocus
  16.     Case Is = 2
  17.        'run code for page3<Me.Page3.PageIndex = 2>
  18.         TabCtl1.Pages.Item(2).Visible = False
  19. End Select
  20. Exit_Continue:
  21.         Exit Sub
  22. Error_Routine:
  23.         MsgBox "Error# " & Err.Number & " " & Err.Description
  24.         Resume Exit_Continue
  25.  
  26. End Sub
Aug 9 '07 #2
JKing
1,206 Expert 1GB
Give this a try:

Expand|Select|Wrap|Line Numbers
  1. Private Sub tabMain_Change()
  2.     If Me.tabMain.Value = 2 Then
  3.         Me.tabSub.Visible = False
  4.     Else
  5.         Me.tabSub.Visible = True
  6.     End If
  7. End Sub
  8.  
Alternatively have you thought about placing the second tab control in a subform? The subform would be bound to a single page.
Aug 9 '07 #3
JKing
1,206 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. Try invoking your code on the change event of the tab control on the main form, something like this:
  2.  
  3. Private Sub TabCtl1_Change()
  4. On Error GoTo Error_Routine
  5.  
  6. 'commits any changes
  7. If Me.Dirty Then Me.Dirty = False
  8. Select Case Me.TabCtl1.Value
  9.     Case Is = 0  
  10.         'run code for page1<Me.Page1.PageIndex = 0>
  11.         TabCtl1.Pages.Item(0).Visible = True
  12.     Case Is = 1
  13.        'run code for page2<Me.Page2.PageIndex = 1>
  14.         TabCtl1.Pages.Item(1).Visible = True
  15.         TabCtl1.Pages.Item(1).SetFocus
  16.     Case Is = 2
  17.        'run code for page3<Me.Page3.PageIndex = 2>
  18.         TabCtl1.Pages.Item(2).Visible = False
  19. End Select
  20. Exit_Continue:
  21.         Exit Sub
  22. Error_Routine:
  23.         MsgBox "Error# " & Err.Number & " " & Err.Description
  24.         Resume Exit_Continue
  25.  
  26. End Sub
Didn't mean to step on your toes there puppydogbuddy. Must have been mid post while you posted.
Aug 9 '07 #4
puppydogbuddy
1,923 Expert 1GB
Didn't mean to step on your toes there puppydogbuddy. Must have been mid post while you posted.
LOL!! Ouch...........
Aug 9 '07 #5
wayniac
19
Thank you, it works excellent now. Could not ask for it to look any better :)
Aug 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide...
9
by: Wang, Jay | last post by:
I try to group several rows in a table into a div and show/hide them by click on a button somewhere with a javascript link. When clicked, the link will toggle the style of the div section's style...
5
by: mooeypoo | last post by:
Hello all, I'm a php developer. I have been using a very simple script to hide/unhide divs in my script: function DisplayI(obj) { obj.style.display=("none"==obj.style.display? "block" :...
3
by: Peter | last post by:
How do I hide and unhide Tabs in the TabControl at the runtime? Peter -- Thanks ------------------- czupet@wsinc.com
3
by: toodi4 | last post by:
I'm using a javascript that hides and unhides text based on a button click. It works great across static fields on a form. The problem I have is that I'm trying to hide and unhide various fields...
3
by: =?Utf-8?B?aWxy?= | last post by:
Hi All I am developing an vb 2005 winforms application that connects to a database and displays a datagridview of the data. A user can select and then edit, or create a new entry by opening a...
1
by: Simon | last post by:
Dear reader, In a datasheet form you have the possibility to hide or unhide columns. But in case the datasheet form is a sub-form this functionality is not longer available.
4
by: somasekhar | last post by:
Does anyone know how to have a user click a checkbox to unhide a editfield Unclick of the checkbox would hide it again. There is an example of html file on the Javascript .But I want hide and unhide...
6
by: Ralph | last post by:
Hi, I was reading effictive C++ and some other books again and they all tell you about hiding implementation details (proxy/pimpl/inheritance) but they never really explain when to use it. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.