>I believe it "finally" dawned on me that there was an issue with that code. if the mouse pointer is left on the add or edit button after either are clicked, the Valid or LostFocus code does not run, "by design"...crap! I have had issues like this (valid code not running), intermittently for a while. Who knows why the light-bulb just turned on! It helps to have the coverage profiler turned on.
>
>When I removed the above reference to "cmdedit, cmdadd" the code works.
>
>Is there a better way to keep the valid from running when closing the form or canceling a process?
I once solved that by moving code from cmdbutton.click() to cmdbutton.when() - and returning .f., so the button never gets the focus. In case of OK button, I'd just thisform.activecontrol.setfocus(), which would force it to regain focus, and to do that it has to lose it first, so the validation fires.
Not sure this is the cleanest way, but at least I didn't have any concerns in the validation about whether it's been fired by a button or by user's simply leaving one control to get to the next.