Dynamic Tabs... (1 Viewer)

CraigDolphin

GrumpyOldMan in Training
Local time
Today, 02:07
Joined
Dec 21, 2005
Messages
1,582
I am developing a database to track fisheries regulations.

Basic data structure is:
  • tSeries(1) - tRegulation(many)
  • tRegulation(1)-tOpening(many)
  • tOpening is the one-side in one-to-many relationships with detail tables like tFisherySchedule, tGearType, tRestriction etc etc.
I have a main form bound to tSeries, a subform bound to tRegulation, and a sub-subform bound to tOpening.

Now, most fisheries regulations contain just one opening, but can potentially contain anywhere up to 10 openings (Very unlikely to go that high I suspect and I could make that an absolute limit if needed).

So, what I would like to do is have a tab control on the regulations subform that would have a tab containing the openings sub-subform. I would like there to be one tab visible for each opening in the regulation, and the data shown in the openings sub-subform be limited to one opening per tab. (A different opening on each tab obviously). Problem is I am stuck on how to approach this task conceptually.

I've thought about trying to programmatically create the tab control on the regulation subform but that (apparently) requires opening the form in design view (not an option if we want to save this as an mde, I think) and I have a nervous twitch about trying to master the new realm of VBA required to do the task.

I've thought about creating 10 tabs and making them visible or invisible depending on the presence of data in the sub-subform but it appears that forms do not have a .hasdata property like reports. And I'm not sure how to go about getting the sub-subform on each tab to show only the correct one of the sequential openings.

I like to think I am weakly/moderately competant using VBA but I'm still a long ways from the level of gurus (IMO) like Rural Guy, Doc_Man, OldSoftBoss etc and would really appreciate a pointer to help me find my direction here. I'm not asking for code examples, just a rough outline of steps that would get me to where I want to be.

If this is a really obvious stupid question then please excuse me. I also may only be able to reply erratically over the next two weeks; since I'm flying back to NZ tomorrow to deal with my mother's funeral. :( Maybe this is why I can't see where I'm heading with this project right now.

Any replies much appreciated. Thanks for reading my long-winded post.
 

Dennisk

AWF VIP
Local time
Today, 10:07
Joined
Jul 22, 2004
Messages
1,649
That is not the way to go about this, as it is very inflexible. Use one subform and a combo box. the combo box to display only the openings that are in the table. The recordsource of the subform should be a query that uses the criteria from the combo box to filter the records. Or in the after update event of the combo box, you could apply a filter to the subform.
 

Users who are viewing this thread

Top Bottom