>Help?!
>
>I have a main form that does this in the init method:
>
> do form custopen name custopen noshow
> do form custclose name custclose noshow
>
>The forms open correctly and do not show in my environment. Then in the click method of a button on the main form I have:
>
> custopen.visible = .t.
>
>And I get an error that object custopen cannot be found. However, I can choose the form 'custopen' from the menu bar, and when I do the dugger shows wontop() as 'custopen'.
>
>In the form designer, the caption is custopen and the name is custopen. The form is built from a class prj2custclass, does that matter?
The variables CustOpen and CustClose will be scoped to the Init method of your main form. These variables will not exist at the global application level. If you try
do form custopen name custopen noshow LINKEDyou will see that the forms get destroyed as soon as the variables go out of scope.
The quick and dirty fix is to declare the form variables PUBLIC
PUBLIC CustOpen, CustClosealthough this isn't the best solution.
You might allocate the sub-forms to properties of your main screen ( I assume that this is possible).
do form custopen name loMainForm.CustOpen noshow LINKEDAnother possibility would be to channel all form create/destroy/show through a Form Manager object that will manage form references internally.