This all depends where your cursor is on the form when you press the keyboard (either up- or down-arrow, or a number).
I assumed you had a field on the form where you select the AC level number to go to.
If you are in the grid, and press an arrow, then the .AfterRowColChange(0 event is triggered. So, in this event you could have code similar to your example, but omit the this.AfterRowColChange()
>In what event of the Grid?
>
>
>
>do case
> case nKeyCode = 5
> select tbl
> do while !bof() and ac_level != '3'
> skip -1
> enddo
> >* nodefault
> case nKeyCode = 24
> select tbl
> do while !eof() and ac_level != '3'
> skip 1
> enddo
> this.AfterRowColChange()
>* nodefault
>endcase
>
>
>It works fine, but it skips 1 record further.
>AC_LEVEL
>1
>2
>3
>3
>if the pointer is on record 1 which is AC_LEVEL = 1 if i press DownArrow it moves to AC_LEVEL = 3 but record 4.
>Any help on this.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.