>Hi,
>
>I have a form that will have a few "lookup" forms that will be opened and hidden quite often. So, I prefer to instantiate these "lookup" forms in the INIT of the parent form. Here is how I tried it:
>
>
>*-- in the INIT method of the parent form
>thisform.NewObject( "LookupForm1", "LookupForm1", "MYLIB.VCX")
>
>
>The error I get is "Object class is invalid for this container"
>
>What am I doing wrong?
>
>TIA
>
>UPDATE: Decided to change the approach:
>Created property oLookupForm1 and then in the INIT of the parent form instantiate it as:
>
>thisform.oLookupForm1 = CREATEOBJECT( "LookupForm1" )
>
>Then, in Destroy method, set value to NULL.
Right. A form can't contain another form, but it can point to one with an object property.
Tamar