>I did code this in the KeyPress before I ask this here. There was nothing, not wait window (so meaning it's the "wrong" place?). And yes, this was the whole propose that Enter fires TABLEUPDATE() and Escape fires TABLEREVERT(), but I need to locate WHERE to put these codes. I want (well, THEY want) to only make this effective only while the cursor is in the textbox (since there is no "Revert" button, just a "Save" button, I know, weird, lot of disabling/enabling). What else you suggest?
>
I don't think you're listening. Characters like 'Tab', 'Enter' and 'Escape' leave the control and are not picked up by it - you'd have to use the Form's KeyPress via KeyPreview. If you want to check the exit keystroke in your valid, use LASTKEY() not INKEY(). This is so simple it's hard to explain to you - the key that triggers the event isn't part of the value of the control, so it doesn't register there.
>Chuck
>
>>>IF INKEY() = 27
>>> wait window 'Esc key pressed'
>>>ELSE
>>> IF INKEY() = 13
>>> wait window 'Enter key pressed'
>>> =TableUpdate(.T.)
>>> ENDIF
>>>ENDIF
>
>>You could trap the KeyPress event of the textbox control to react to the Enter or Escape; KeyPress receives the keycode for each keystroke other than Alt-key sequences or things like Tab. You can process all keystrokes in the Form's KeyPress event by setting the Form's KeyPreview to .T.
>>
>>BTW, if you want to TABLEUPDATE() on Enter, you probably want to TABLEREVERT() on Escape.