Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid check prevents form exit
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00613711
Message ID:
00613744
Vues:
7
Richard,

The others have given you some ideas of how to do what you are asking. I would propose that the code in your Valid event is incorrect. Why? Becuase the purpose of the Valid event is to determine if the user may leave the control and if not stop them. In your case the code is stopping them from leaving when it should not do that.

The first thing to do in correcting this situation is to remove the association in your mind of the Valid event and data validation, that is NOT what the Valid event is designed to do for you.

Once you have done this you can divide the data validation process into two steps, assistive validation (help the user to get it right in the first place) and absolute validation (prevent bad data from getting into the database).

Absolute validation should not be done until the user has told the system to save the data because prior to this the user may be doing any of a number of things other than trying to save.

Assistive validation can be done using the Valid event, but because of it being assistive it should not prevent the user from doing anything they want. It can suggest to the user that the value in the control is invalid, but it should allow the user to continue on with whatever they were trying to do. Only when the user says "Save this" should the operation be frustrated if the data is invalid.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform