Hi Sergey,
>You've correct code in nKeyCode variable. The LASTKEY() will be updated after .keypress() completes.
Are the any other conditions that must be fulfilled for this to happen? I'm asking, because I've never seen LASTKEY() have a different value in the KeyPress event that I would expect. It certainly doesn't when I copy and paste the code from the OP into a sample form. I get -4 for both variables.
--
Christof