Instead of trying to use the grid rows/columns, try using the alias itself. This seems to work ok:
LPARAMETERS nKeyCode, nShiftAltCtrl
Local lcAlias
lcAlias = This.Parent.Parent.RecordSource
IF nKeyCode = 13
NODEFAULT
If !Eof(lcAlias)
Skip in (lcAlias)
Endif
ENDIF
Alan
>I'm tring to add a behavior to a grid where when enter is pressed the active row in moved down by 1 while staying on the same column
>
>The problem I'm having is very strange
>
>On the Keypress Event of the control on the column I'm interested in introducing this behavior to I have the following code
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>
>IF nKeyCode = 13
>
> NODEFAULT
> thisform.vgrid2.ActivateCell(thisform.vgrid2.ActiveRow+1,;
> thisform.vgrid2.ActiveColumn)
>
>ENDIF
>
>It seems pretty simple... The problem is It works fine for about 15 or so records and then stops working.. Trided a few diffrent data sets and had the same problem.. If i use the scroll bar the behavior becomes even more eratic sometimes skiping several rows down. I placed watches on the rows and colums. It all seems to look fine for the first few enters then just stops working or eraticaly
>
>thanks in advance for your advice