Add a property to the form (grid_has_focus)
In When method of the Grid put
thisform.grid_has_focus = .t.
In Valid method of the Grid put:
thisform.grid_has_focus = .f.
Set the KeyPreview property of the form to .t.
In KeyPress method of the form:
IF thisform.grid_has_focus
* Use press a key on the grid
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.