Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
QueryUnload / Valid events
Message
 
 
À
21/09/2005 11:37:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01051626
Message ID:
01051882
Vues:
15
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform