Dynamically loading sub forms....

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I have a master form on which I want to be able to dynamically load various
subforms - depending on a user selection. The user selects options on the
left side of the screen and I want to be able load the subform directly onto
the main form (on the right hand side) which contains data pertinent to the
option the user selected on the left...

How can I create a "container" on a master form which I can then
programatically load various subforms into??

Thanks,

Brad
 
Set the SourceObject property of the subform control to the name of the form
you want to display.
 
Two ways:

1. Actually put all the subforms on the main form (all in approx the same
spot, sort of one on top of the other) and then programmatically make all
but one invisible (visible = false) based on the option the user selected on
the left side of the screen. Note that you're making the main form's
subform controls visible or invisible -- you're not making changes to the
subforms themselves.

2. Have one subform control on the right hand side and then dynamically
change its SourceObject. Note that this may require dynamically changing
the LinkChildFields and LinkMasterFields properties (if they differ w/
different subforms) and may not look as good if each subform is a different
physical size.
 
Back
Top