IF nKeyCode = 13 OR nKeyCode = 9 && Enter or Tab This.Move2NextRow() NODEFAULT ENDIFCode in Move2NextRow() follows:
LOCAL lnMaxRows WITH This.Parent.Parent *** Calculate the maximum number of rows in the grid lnMaxRows = INT( ( .Height - .HeaderHeight - ; IIF( INLIST( .ScrollBars, 1, 3 ), SYSMETRIC( 8 ), 0 ) ) / .RowHeight ) IF .RelativeRow >= lnMaxRows *** This means we are on the last row in the visible portion of the grid *** So we have to scroll the grid down one line .DoScroll( 1 ) ENDIF .ActivateCell( .RelativeRow + 1, .RelativeColumn ) ENDWITHMarcia