What about this:
Set the Cancel for both buttons to .T.
Add this to the keypress of the form:
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27
NODEFAULT
thisform.Command2.Click && Call click of button esc should actuate
ENDIF
and set the KeyPreview property of the form to .T.
This should force the Escape to click the desired button.
Jim
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.