Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
QueryUnload / Valid events
Message
 
 
To
21/09/2005 11:37:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01051626
Message ID:
01051882
Views:
8
Cheers Fabio,

It seems like what I need to do is to have all my form based controls raise a form based property that indicates that a valid event has raised a problem and prevent the form from closing ;

something like

form.Txt_Name.Valid
If empty(this.value)
   messagebox('Name cannot be blank')
   thisform.lValidationBroken = .T.
else
   thisform.lValidationBroken = .F.
endif
And then on the queryunload event have code something like this ;
* Check to see if the form has a validation rule that is broken
If lValidationBroken
   NoDefault
   Return .F.
Endif
I suppose one of the problems here is that we have row level validation that occurs and form based validation.

The row based validation only fires when the user has changed a value in a grid control, if they then want to close the form with the X, we need to validate the entries before asking them if they want to save.

I suppose the same thing could be achieve by using form based validation and calling that from the save method.

Any thoughts anybody?

Thanks, Bernard
Previous
Reply
Map
View

Click here to load this message in the networking platform