Dimitris,
I can't help you out on the COmmandButton, but as per the Close Button, this line of code in the Valid() can apply :-
IF INLIST(THISFORM.ReleaseType,1,2)
RETURN
ENDIF
* :
* :
* Other validation code here
I've been using this extensively. Tell me what you think.
>Thank you all for the reply. I think Josh's solution is the most simple and worked fine.
>
>But still there is a situation (which i did not mention in my first message) where none of the solutions worked. When there is a close button on the form the valid event still fires when you hit it. I could not find a solution for this so far.
>
>Thanks in advance for any advice on this one.
>
>Dimitris
Kenneth.