>The Megafox book discusses how to have the bottom of a grid fill the last page when a form is being instantiated. I would like to know the solution to a slightly different problem. If I am on the bottom displayed row of a one-column grid and that also corresponds to the last row in the record source, pressing the down-arrow or page-down key will cause a single-row scroll. The action causes me to stay at the same point in the record source and on same grid cell (as it should), but there is now a blank row at the bottom of the grid. Is there a way to prevent this? Visually, when positioned at the bottom, I want a down-arrow or page-down keypress to result in no change to my grid's appearance.
>
>TIA,
>-mark
FWIW.........I'm not sure I would agree with this behavior. Users tend to get antsy when they press a key and nothing happens. At least the default behavior lets them know they are at the bottom of the list.
However, you might try this.
In Yourgrid.Column1.Text1.Keypress.........
LPARAMETERS nKeyCode, nShiftAltCtrl
IF INLIST(nKeyCode,24,3)
SKIP
IF EOF()
GO BOTT
IF this.Parent.Parent.RelativeRow = this.Parent.Parent.GridLines
NODEFAULT
ENDIF
ELSE
SKIP -1
ENDIF
ENDIF