ACC: SendKeys Macro Action Doesn't Work on Toggle Keys (1.x/2.0)Last reviewed: May 28, 1997Article ID: Q101125 |
The information in this article applies to:
SYMPTOMSAdvanced: Requires expert coding, interoperability, and multiuser skills. A SendKeys macro action will not work correctly on the toggle keys CAPS LOCK or SCROLL LOCK. You may see the CAPS LOCK or SCROLL LOCK lights flash on the keyboard, but the lights will not remain on and the keys will not be correctly activated after the SendKeys action is completed. Note that SendKeys also will not work correctly with the ALT+PRINT SCREEN key combination.
CAUSESendKeys keystrokes are sent to applications at a high level. Microsoft Windows 3.x traps toggle keys and the PRINT SCREEN key at a lower level, keeping them from your application.
RESOLUTIONNOTE: In the following sample code, an underscore (_) at the end of a line is used as a line-continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic. There is a workaround for the CAPS LOCK problem. To force input in a field into uppercase, set the control's Format property to ">". The UCase() function can also be used to force entries in a field to uppercase. Although a SendKeys macro action cannot toggle keys, a Windows API SetKeyboardState() function call can toggle keys. The following example demonstrates how to use the Windows API SetKeyboardState() function:
MORE INFORMATION
Steps to Reproduce BehaviorThe following SendKeys action will not toggle the CAPS LOCK key to on:
MacroName Action ---------------------- Macro1 SendKeys Macro1 Actions -------------------------- SendKeys Keystrokes: {CAPSLOCK} Wait: NO REFERENCESFor more information about SendKeys, search for "SendKeys Statement" using the Microsoft Access Help Menu. For more information about API functions, search for "API" using the Microsoft Access Help menu.
|
Additional query words: send key num
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |