Subform in Tab Control

P

Peter

We use a Tab control with 4 tabs. Each of them contains
at least 1 subform.

We would like to know do all the subforms are loaded when
the form containing the Tab Control is loaded ?

Is it possible to load the subform on demand when we
select the corresponding tab ?

Thanks
 
V

Van T. Dinh

Yes. All Subforms are loaded when the Main Form / Tab Control is loaded.

I normally use a Tab Control but only for the little tabs on top with *one*
Subform Control on the Main Form (not on a Page of the Tab Control) and then
use code to swap the SourceObject of the Subform Control when the user moves
around in the Tab Control. This one, I load only one Subform at a time.
 
P

Peter

Dear Van,

Thank you for your advice.

I would like to know for *1* subform with different
SourceObject, is it necessary for us to have the same
structure for *all* subforms - Like: same number of
columns, the same column caption, the same data type ?

If yes, it seems that there is a great restriction.

Thanks
 
R

Rick Brandt

Peter said:
Dear Van,

Thank you for your advice.

I would like to know for *1* subform with different
SourceObject, is it necessary for us to have the same
structure for *all* subforms - Like: same number of
columns, the same column caption, the same data type ?

If yes, it seems that there is a great restriction.

No, but if you want to display them in the same subform control they will
need to be the same size (or at least smaller than the control) and have the
same linking fields (if you are using the Master/ChildLink properties). For
the last your code that changes the source object can also set the
MasterLink and ChildLink properties as appropriate.
 
V

Van T. Dinh

No.

Think of the Subform *Control* as the empty rectangle (which it is). Inside
this rectangle, you can place any Form (bound to any DataSource or even
ubbound) as the SourceObject of the Subform Control. Thus the SourceObjects
can be independent / different from each other.

The confusing part is that when we / Access books / Microsoft talk about
"Subform", the term generally refers to both the Subform Control and the
SourceObject.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top