View Full Version : Load different subform base on a criteria in main form combobox


Alexandre
02-23-2001, 01:17 AM
I am facing the following problem: In a main form I have three imbricated sub forms (one related to provinces, contaning one related to municipes, containing one related to cities).

Based on the level of approach (national, regional, local) chosen in a combobox of the main form, I would like either only the two first level of subform to be loaded, or the three of them.

Making the third level sub form visible-invisible using the after update event of my main form is not a satisfying approach: I would like the after update event to make the third level sub form unload, or to replace the whole set of three imbricated subforms by another (pre-created) with only two levels.

Resuming: how to unload a sub form (and eventually load another one) using the After Maj event of the main form?


Many thanks in advance for any help.

llkhoutx
02-26-2001, 12:15 PM
Test which is being loaded and then hide or not the appropriate subform.

Jack Cowley
02-26-2001, 01:58 PM
You can determine which subform is loaded by progammatically changing the Source Object for the Subform. Search Help for more information on Source Object.

Alexandre
02-27-2001, 01:34 AM
llkhoutx,

Thanks for your contribution. Nevetheless, simply hiding the form is not a satisfying solution in my case.

Alexandre
02-27-2001, 01:38 AM
Jack Cowley,

Thank you for your help. This is certainly the way to do, and I am going to work on that. By the way, is there a way to progammatically close a subform from the main form?