Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to bypass Valid event
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00846883
Message ID:
00846942
Views:
24
Checking lastkey() as suggested by David will fail if lastkey has already been 27 before taking action and the user leaves the textbox by clicking on another control other than the Canc button since a mouse click does not change the lastkey value.

Creating a property lCloseNoValid as suggested by Michel is not necessary since ReleaseType will do the job.

Solution suggested by John in FAQ #7765 might be a bit complicated.

Please try the following:
Do Case
Case !Wontop(Thisform.Name)  && Activating another form. No validation
  Return .T.
Case Thisform.ReleaseType>0  && Quiting VFP or clicking on form's close box. No validation
  Return .T.
Otherwise
  oObj=Sys(1270)
  If Vartype(oObj)='O' And oObj.Name='cmdCanc'  && Clicking on the Cancel button. No validation
    Return .T.
  Endif
Endcase
... validation code goes here...
Ben
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform