Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display error message
Message
De
03/09/2007 17:07:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
03/09/2007 16:58:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01252035
Message ID:
01252036
Vues:
15
This message has been marked as the solution to the initial question of the thread.
>Hi everybody
>
>When using the valid event in a form's object if an error occurs, the message "invalid entry" is displayed. How can I display my own error message?..
>
>
>Thanks in advance.
>Carlos Burgos

While this is not a direct reply to your question, I think you should do the validation only when the user presses the "Save" button, for the following reasons:
  • The user should have the freedom to input data in any order. I see no reason to force the user to put a value into one field, when he might prefer to go to another field first.
  • If you validate each field, you have no guarantee that the user goes to each field. Thus, if the rule says [not empty(MyField)], this rule - when placed in the Valid() or LostFocus() method - might never get fired. The user might click the "Save" button directly, without going to every field.
  • Some validations cover more than one field. For example, in accounting, either debit or credit should have a value, but not both. Or, in Bata Bolivia, depending on the type of material, some require longer codes than others.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform