>ohhh i'm sorry.. when user enters a different date in the txttodate.
>
>initially user enters txtfrdate. at lostfocus(), i set txttodate value to txtfrdate. but my user can or may change the value of txttodate.
>
>if i type 05212004 in txtfrdate, txttodate changes too as txtfrdate loses focus. when i type only 0524 at txttodate, then press the save button (=tableupdate(.t.), value of txttodate changes back to the value of txtfrdate. but if i type 05242004 in txttodate, txttodate becomes 05242004.
I would change the value of TxtToDate only once, in TxtFromDate.LostFocus(); and then leave it. Something like this:
if empty(ThisForm.TxtToDate.Value) or ThisForm.TxtToDate.Value < This.Value
ThisForm.TxtToDate.Value = This.Value
endif
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)