Subject Re: closing form
From Milind Nighojkar <milinigh@yahoo.com>
Date Thu, 25 Nov 2021 12:18:48 -0500
Newsgroups dbase.getting-started

Hi Akshat,
Thanks for the reply. I learned the new way of hadling it. Also a new syntax.

I tried but could not succeed.

I will once again give it a try and will connect with you on this.

Regards

Milind Nighojkar

Akshat Kapoor Wrote:

> Good Evening Milind,
>
> > Scenerio. form A is opened
> > Wanted to close this form
> > Iuused a syntax : CLOSE FORMS A
> > Get error : No such form A
> >
> > Any suggestions
>
> I would suggest you have a look at help of findinstance()
>
> In the below example e_sales2form is the class name
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 29.10.2021
> //
> parameter bModal
> local f
> f = new e_sales2form()
> if (bModal)
>     f.mdi = false // ensure not MDI
>     f.readModal()
> else
>     f.open()
> endif
>
> class e_sales2form of MUNEEM from "muneem.cfm"
>
>
>
> So something of the following sort should work
> X =  findinstance('e_sales2form')
> if not empty(X)
>         x.close()
> endif
>
> If you are executing the code from within the form then simply
> form.close() is sufficient.
>
> I hope this helps.
>
> Regards
> Akshat