>>>I am using a grid for data entry. Every control on the grid is marked ReadOnly = .T., TabStop = .F. except for the one I want the user to utilize. >>> >>>I want / to move the user to the next record; -- moves back one record. I have the following code in the KeyPress event: >>> >>>IF nKeyCode = 13 .OR. nKeyCode = 9 >>> THIS.LostFocus() && Calc. & display the premium >>> SKIP >>> IF EOF() >>> WAIT WINDOW AT 20,20 "Last advice on file for target date." >>> SKIP -1 >>> ENDIF >>> This.SetFocus() >>>ENDIF >>>IF nKeyCode = 15 && Shift--tab >>> THIS.LostFocus() >>> SKIP -1 IN Transact >>> IF BOF() >>> WAIT WINDOW AT 20,20 "First advice on file for target date." >>> ENDIF >>> THIS.SetFocus() >>>ENDIF >>> >>>Doesn't work. All it does is wipe out the user's input and shift focus to the next column to the right. If I press the , everything works beautifully. What have I done wrong in my code? How can I make and emulate the key? >> >>I think that all you need is: >> >>DO CASE >> CASE nKeyCode = 13 .OR. nKeyCode = 9 >> KEYBOARD "{DNARROW}" >> CASE nKeyCode = 15 >> KEYBOARD "{UPARROW}" >>ENDCASE >> >>Vlad > >Vlad: > >Thanks for kicking in here. Your code certainly gets me much closer to the desired behavior than mine! One thing is still wrong, however: while a TAB or ENTER now moves me down to the next row as desired, I continue to be shifted over to the next column. Using just DOWN ARROW moves me straight down, which is what I want. Any idea how to suppress the movement to the right? > >TIA. > >John