>From form1 a call form2
>
> Thanks for opininos but I need that form1 is only released
> after form2 is released too.
>
>
> I've tried
>
> Do form1 to myform
> do form2
>
>From form2 I put
>
> release myform and form1 does not disapered
>
> What's wrong ?
"Do form1 to myform" will create an object reference not in variable myform, but in a variable with a probable name of form1. Variable myform will receive the value returned by form1.unload (if it's modal).
If you want to have a variable with a name of your choice, you should have
do form1 name myform
One thing to beware is the scope of the myform variable - you may want to make it public, or a property of a persistent object. If form1 is modal, this is no problem, but then you can't access your variable until the form exits - or hides.