Worked for me in my simple test case. It also doesn't seem to work if you step through it in the debugger. (Something about RelativeRow isn't set properly, I think) Just to be sure..........did you put it in the indicated event?
Grid.Column1.Text1.Keypress
>Hi Rich,
>
>Thanks, I tried your code, but there was no change in the grid's scrolling behavior.
>
>I previously tried using OKLs to turn off the down-arrow and page-down keys when
>the record pointer was on the bottom record, and that made no difference, either.
>
>I'm going to play with this some more on Monday.
>
>-mark
>
>================
>
>>>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