>Hi everybody!
>
>Is there a way, to determine in a textbox valid routin, that which the next object is? I don't mean the "next" as in order, but the one, whose activation caused the valid routin to fire.
>
>The reason is, that sometimes I don't want to run the valid routin to go. E.g. when user push Exit button, Or Cancel button, when there is unnecesarry to validate the contents of the textbox. But How can I determine, which object on screen caused the valid routin to go?
>I thought, that the validation should make in the when event of all other objects, but it is unconvient.
>Any comment?
>
>TIA
>
>BB
Bela,
Set the cancel property of your exit button to .T. and in your valid code do this first;
IF LASTKEY() = 27 && the escape key
RETURN .T.
ENDIF
* The rest of your code here