Send all the characters in a single SendKeys statement. -or-
Execute a DoEvents function between each SendKeys statement. However, depending on the complexity of the key strokes, this may not work in all cases. -or-
Determine the setting of the NumLock key prior to using SendKeys. Then, turn off the NumLock before using SendKeys. After using SendKeys, reset the NumLock to its previous setting. This is accomplished using the GetKeyboardState, keybd_event and SetKeyboardState API functions. See the REFERENCES section below for more information. -or-
Use API functions instead of SendKeys. See the REFERENCES section below for more information
It's a replacement function that allows you to do the same thing as sendKeys, but without the bugs. A very nice solution, which I use to do some critical stuff.
On the other hand, in general it is far better to come up with other ways of doing things than using SendKeys, whether the Access native function or this one. The reason is that when you use SendKeys you rely on the environment being exactly the same as it was when you wrote the code. If you're using this to make changes to data and the menus change, or the user does something while the code is executing, or any number or other thigs go wrong, you could easily find yourself up a stinky creek, looking for a paddle.
If you let us know what you want to use SendKeys for, there's a good chance we'll come up with an alternate solution.
Jeremy =============
Jeremy Wallace
AlphaBet City Dataworks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.