*-- textbox.KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl DO CASE CASE nKeyCode = -1 && F2 = Edit mode This.ilEditMode = .t. CASE nKeyCode=27 && ESC IF This.ilEditMode *-- if we're in edit mode, reset mode and *-- suppress the ESC key *-- Note: this code doesn't work if the textbox is in grid! ThisForm.ilEditMode = .f. NODEFAULT ENDIF *-- etc... ENDCASEThe idea is to suppress the ESCAPE key if we're in edit mode. NODEFAULT doesn't prevent the form from being closed. The same textbox works perfectly if it's outside of the grid. Is this a known bug or am I missing something?