>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)