Hi,
You may need to combine what were suggested by Cetin and Albert and add more steps to ensure it. I tried to do what you wish a week ago, I feel that what were told is not always return right "answer" because amouse() and sys(1270) may return the previous result (ever click before on other forms). Therefore, when lostfocus, it may be escaped from validation. Again, mdown() not always (but most of the time) return .T. even you clicked as I tried.
What I did are, check for _SCREEN.ACTIVEFORM.NAME with THISFORM.NAME and check fot FORM.RELEASETYPE to let user close form without any error messages.
If you found any "shortcut", please inform me.
Hope it helps
Thank you
John Jones
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...