Is there a way to check the .isLoaded status of a child form without
scanning through the Forms collection, recursing through the .controls to
find all the sub-forms and sub-sub-forms and compare the name?
Not really. I think you are confused by what a sub-form is!!!
A sub-form is simply a contorl that you place on a form.
Eg:
If I have a form that is attahed to a table called cutomers, then I can
place a text box contorl on the form, and call it zoo1
zoo1
I can then set the data souce of that above contorl to company name.
Now, I can place another cntorl on the form, and call it
zoo2
I can then set the data souce of that above contorl to company name.
What this means is that I cna have TWO contorls on the SAME form, and bind
them to the saem field.
The same thing occurs with a sub-form. I could have palce two sub-form
contorls on the form, (called them zoo1, and zoo2). You cna set set WHAT
FORM this sub-form contorl is attached to. Note hat you BOTH CONTORLS can be
set to the SAME form that you plan to use for the sub-form (you will see the
from two times on your form!!!).
So, which exalcity version of teh sub-form do you want to know is laoded?
You cna have muoplate instances of the smae form laoded over and over (in
fact that is how I created my calendar form!!).
You see an example of the calender form here:
http://www.kallal.ca/ridestutorialp/setdriver.htm
Note that this means I have 42 SUB-FORMS!! and, they are ALL the same
form!!! (by the way, using this concept means you can builds a way cool
programmable calendar form in just a few hours of time!!).
So, all of the above begs the question, and that question is WHAT copy of
the sub-form do you want to know is loaded..and why?
Since there can be as my example shows 42 copies of the same form loaded,
then really the isloaded() is of no use?
For what reason do you need to check if the sub-form is loaded? (why not
check if the main form is loaded that has the sub-form control?). That would
be MUCH better, as you can't just referenced the forms() collection for a
sub-form, since you don't know what copy of the sub-form is loaded! (a
sub-form creates a NEW INSTANCE of the sub-form).
You might want to expand on why you need this information, but if you have
two forms open, and they both have the same sub-form, then you have two
copies of the sub-form running. (and, all of their code, variables etc. has
a complete separate set of values...they don't interfere with each other).
Knowing that a form is being used as a sub-form is really of no value, since
you don't know WHICH copy you are going to reference (and, further, the
sub-form is NOT added to the forms collection when loaded as a sub-form --
it would not make sense to do so either!!!).
So, do expand perhaps on what you are trying to accomplish here, but it
seems to me the way to check here is to simply check if the main form is
loaded....