When using SendKeys to turn an Enter keystroke into a Tab keystroke (SendKeys "{TAB}"), NumLock will briefly turn off. When users are keying rapidly, they enter data into a field and hit the Enter key. The focus moves to the next field, but if they enter something else on the numeric keypad, it is interpreted as PageUp, PageDown, or whatever the number key represents without NumLock.

There is a database call on LostFocus that may take 1 or 2 seconds, and NumLock will not turn back on until this operation completes. However, if I actually use the Tab key, this delay still occurs, but NumLock will not turn off.

I have tried using the Wait option after SendKeys, but it does not make a difference. I have also inserted DoEvents at various places without success.

This happens only on Windows NT and Windows 2000. Windows 95 is not affected, and I have not tried it on 98 or XP.