Augusto,
Set the CANCEL property on your button to TRUE. THen in your LostFocus method for your textbox, put:
if lastkey() = 27
return
endif
If a command button has CANCEL = TRUE then it appears internally as if the user clicked the ESCAPE key.
HTH
Barbara
>hi all
>
>i have a requery in vfp5.0 thats runs every time that my textbox "text1", lost focus ( all that its ok).
>
>but when i click on the close button i wanna that the requery dont be run when the lostfocus of my tetxbox occurs. (cause when i click on my close button the focus its on the text1 object,, so the requery runs increase the time to close the form)
>
>are there any tip to make it work ??
>
>TNX