>Just so you're not in suspense: I figured out my problem using the form.keypress method and testing for nKeyCode = 27. Thanks for the suggestion, but this approach doesn't require a separate .prg file so I like it a lot!
>
>Kevin
Glad to see you found a solution. Based on what I've read, it seems like you're trying to close the form by pressing Escape. If that's the case, check the CANCEL property of buttons. If set to .T., that button will be pressed when the user presses Escape.
To get back to that ON KEY LABEL thing, what I do when I need such a thing is that I put "ON KEY LABEL
cKeyName DO _VFP.ActiveForm.
cMethod" in the Activate event of the form, and I put "ON KEY LABEL
cKeyName" in the Deactivate event, so this way I'm sure that the ON KEY LABEL is "valid" only in my form.
Sylvain Demers