I agree, except that there are some mission critical apps where this is not an option. In some apps, the record stays open and edited until no longer needed and is updated while something is occurring. In that case, the value must be saved when focus leaves the control and that value must be immediately visible to all other users. When that is case, I choose to use the LOSTFOCUS() when possible instead of the valid.
>>Dear Experts
>>These codes are on text1.valid event
>>
>>IF m.getvalue=0
>>MESSAGEBOX('Rate Not Found'+CHR(13)+'Please check rate','Accounting System')
>>return.f.
>>endif
>>
>>For some reasons I do not want to use above codes on Valid event,
>>How to use some other event, if m.getvalue=0 then control must reamains in text1.
>>
>>Pleaes help
>
>I prefer to do all validation when the user tries to save data. Some advantages:
>
The user may thus input data in any order. If you use a valid() event or something similar, the user may not even press a "Cancel" button - the error message will still appear.
>Sometimes some validation involves more than one field.
>It is also simpler to program that way.
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"