>Generally, you guys prefer to to do your data validation in the valid() or lostfocus() event ? Which is better ?
>Thanks in advance for you great guys advice.
Depends on what you're validating. format? required? value compared to another value?
I never use the LostFocus() for validation. For performing some action based on the value, maybe.
If the field absolutely has to be validated before letting the user out of it, I use the Valid().
If the control is bound to a field, VFP handles some of this for you. (no alpha in numeric fields, date field formats, etc.)
Mostly, though, I handle validation before attempting to save the data. That way I can catch all problems with it and give the user one error message so they can fix it all at once.
Insanity: Doing the same thing over and over and expecting different results.