Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Craig Moore
  Where is Craig Moore?
 
 United Kingdom
 Craig Moore
 To: Michael Gill
  Where is Michael Gill?
 Flora
 Illinois - United States
 Michael Gill
 Tags
Subject: RE: Event before exiting from a form
Thread ID: 21748 Message ID: 21780 # Views: 21 # Ratings: 0
Version: Visual FoxPro 7 Category: Forms
Date: Tuesday, April 01, 2003 5:03:01 PM         
   


I use something like this in my exit code, note, i set closeble to .f. in most cases

lnState = GETFLDSTATE(-1)
IF '2'$lnState OR '3'$lnState OR '4'$lnState
	nAnswer = MESSAGEBOX('You Have made changes do you want to Save?',35)
	IF nAnswer = 2
		RETURN
	ENDIF
	IF nAnswer = 6
		thisform.cmdSave.Click
	ENDIF
	IF nAnswer = 7
		thisform.cmdUndo.Click
	endif
ENDIF


> > > Dear All,
> > >
> > > I wanted to excecute save checking procedure before exiting from a form
> > >
> > > More Details :
> > > I have a data entry screen , I wanted to check whether the data entered in the form are saved in the table, there is procedure writen in the from to do that
> > >
> > > Pls tell me which event can be used for this, I have tried lostfocus,unload event and query unload, but none of the events are working
> > >
> > > Jijo David
> >
> > Hi, the QueryUnload event should do it when you exit using the cross button at the top-right of your form (X). For more details you can refer to Tastrade sample shipped with VFP it is done this way. Good luck.
> >
> > Khalil Shaddad (Lebanon)
>
> Khalil is right, but remember that the QueryUnload event doesn't fire when you issue "thisform.Release". So, if you want to have an exit button AND use the X on the window you'll have to have your exit code in two areas or make a custom method you can call from both areas.
>
> ---
>
> www.foxite.com - The Home of the Visual FoxPro Experts


COMPLETE THREAD

Event before exiting from a form Posted by jijo david @ 4/1/2003 8:40:46 AM
RE: Event before exiting from a form Posted by sudhir uppal @ 4/1/2003 10:12:34 AM
RE: Event before exiting from a form Posted by Khalil Shaddad @ 4/1/2003 1:35:35 PM
RE: Event before exiting from a form Posted by Michael Gill @ 4/1/2003 4:52:30 PM
RE: Event before exiting from a form Posted by Craig Moore @ 4/1/2003 5:03:01 PM