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