Hiding tabs on a Tab Control

Stitcho

Registered User.
Local time
Today, 19:15
Joined
Feb 7, 2008
Messages
38
I have on one of my forms a tab control with 5 different tabs on it. Each of the tabs has a different set of fields but all from the same table. I was wondering if it is possible to hide a tab if none of the fields on it have any data in?

So for example tabs 2 and 3 have data on them but tabs 1, 4, and 5 dont. I would want to hide tabs 1, 4 and 5.
 
I disable individual tabs to do this.

I think I get what you mean but if I disable a tab in the form it doesnt appear at all even if there is data in the fields on the tab?

I would need some sort of dynamic tab control on it I think that would say something like: if field xxx is null then do not display tabx
 
Simple Software Solutions

Hi

A bit data intensive but workable is to create 5 new fields in the main table all Boolean, one for the visibility status for each tab.

If tab one holds data for fields 1-5, tab 2 for 6-10, etc.

Set the value to False for all new records. Then during data collection if you enter data into fields 1- 5 then update fldTab1 = True, etc

If you are using a bound form then on the On Current Procedure of the form set the tab control page index to the value of the fldTabx value.

Eg
Me.TabCtrl.Tab(0).Visible = fldTab0

If you ar using an unbound form then when you populate your unbound controls apply the visibility to the contents of the fldTab.value.

My only concern is if you have the tabs hidden or disabled how are you going to add data to the fields from within the same form?

Code Master::cool:http://www.icraftlimited.co.uk
 
Thanks for your reply DCrake but im afraid most of that is over my head :eek:

I've actually restructured the data slightly now anyway so I shouldnt need to hide the tabs and also I came to the same conclusion as you of how do I add new records to hidden tabs.
 

Users who are viewing this thread

Back
Top Bottom