Subject Re: closing form
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Mon, 22 Nov 2021 19:59:54 +0530
Newsgroups dbase.getting-started

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