Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXITING A VALID METHOD

Status
Not open for further replies.

FMSOFT

Programmer
May 31, 2013
7
ZA
Hi There, I am fmsoft. I develop visual Foxpro applications IN version 6 and 9 (NON WEB BASED). I have an issue... How Do I click on let's say, a 'Cancel' button once I am in a valid method of an object on a given form, if the object I am validating returns 0 OR .F. please help?
 
Place the Cancel button on a toolbar. Since toolbars never get focus, the object in question will never lose focus, so the Valid won't fire. In the same way, you can also cancel from a menu bar.

Welcome to the forum, by the way.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
If you place the button on a form, you should set it's Cancel Proeprty to .T. , this way the button also causes a keypress of ESC, and your validation code must let this pass through, then by checking IF LASTKEY()=27. If that's the case, don't validate.

In general validating data right in the valid event is a bummer, you typically buffer data and only validate whole records or even all changes before saving.

Bye, Olaf.
 
Thank you Guys, and by the way, I apologize for inserting my subject above with Caps, I only later realized that its NOT forum ethics.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top