Set the buttons CANCEL property to true. Then in your lost focus check for LASTKEY()=27. If the lastkey was 27 then they cancelled otherwise they lost focus by some means other than that button.
>I have a list box that in the lost focus event fires a necessary procedure. I want to skip this when someone presses the cancel button. How do I trap for that specific object?
>
>I was thinking of :
>if ThisForm.Command1.????
> return
>endif
>
>what should the ??? be ?
>
>TIA
>
>__Stephen
Everything we see or seems
Is but a dream within a dream - Edgar Allen Poe