Hi Dimitris --
I have a paper in the KB here about this exact problem. In general, you can use the MDOWN(),MROW(), and MCOL() functions to trap the region where the mouse is being clicked within the Valid and return .T. if it maps out to the Cancel button. Check out the paper, it goes into precise coding.
>There is sometimes a situation where you want to bypass the validation check when you click a specific (Cancel - to exit the form) button but it seems there is no way to do this. It would be nice for instance if in the valid event of a textbox control i could specify that when clicking the thisform.cmdCancel to bypass the valid event of the textbox control. You cannot do this or am i missing something
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05