Wonder no more - I have a tab control that produces a reconciliation report,
each month.
I want to create a 'Rec Results' tab for each calendar month and so, I would
like to add a new tab as a month's data is processed.
It's a perfectly valid requirement, set against an imperfect tab control.
But, if creating each tab in advance and hiding it is the (messy) way, sobeit.
Instead of using tabs, we use "panels". They're in a listbox on the
left side of the form, and their friendly names and subform object
names are in a table. Each panel is a separate subform that gets
loaded when needed.
To see a visual example, see page 12 on in the Best of Both Worlds
slide deck at
www.JStreetTech.com/Downloads.
You could dynamically show the appropriate months in the panel list,
along with any other general panels you might need. I think this
would be easier for your users to navigate (espcially when you need to
show a lot of months) and may also be a performance improvement, since
the panels are only loaded when they're clicked, while tabs are
normally loaded when the form first opens.
The technique in a nutshell: when the panel is clicked in the
listbox, replace the subform control's sourceobject with the one from
the panel table. If you have Master/Child properties, you should also
reset those too, as some versions of Access drop those when the
sourceobject changes.
Much less messy than creating tabs on the fly.
Armen Stein
Microsoft Access MVP
www.JStreetTech.com