Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close the form, using _screen.activeform
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
How to close the form, using _screen.activeform
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01009903
Message ID:
01009903
Views:
48
Hi to all,
I am a software programmer in a company making accounting and inventory softwares.
I have to make a logout option in my software, when ever the user click on logout in the menu, all the form should close and the user login form should re-run.

I have partly solved this problem, but i am sort of stuck in the middle.
In my software there is one main form, which has the property of Alwaysonbottom as .T.
which has the name= "Main"

so i have written one simple routine to close the remainning forms

do while .t.
xFrmName = _screen.activeform
if xFrmName = "Main"
exit
endif
xFrmName.release
enddo

the above code is running absolutely fine, but it crashes in one condition,that is if any of the forms which are open have the focus on the grid, then it does not releases the form, as a result it goes in the indefinite loop.
i tried using release form, clear windows etc. but it did not work either

pls help me, how to close the form, having the current focus on the grid.

Thank You

Yours truly
Riyaz Patanwala
Real Time Technology
Dubai
U.A.E.
Riyaz Patanwala
I. T. Programmer
Al Jaber Energy Services L.L.C.
P.O.Box 47467
Abu Dhabi, U.A.E.
Tel - +971 2-502-1644
Fax - +971 2-554-6106
Cell - +971 50 358-0229
Email - riyaz.patanwala@ajes.ae
Website - www.ajes.ae
Next
Reply
Map
View

Click here to load this message in the networking platform