Microsoft KB Archive/96579

= ACC: SendKeys Macro Does Not Run =

Article ID: 96579

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q96579



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
A macro that includes a SendKeys macro action does not run the SendKeys action.



CAUSE
If the Wait argument for the SendKeys action is not set to Yes, the macro action is run after some delay. Depending upon the following macro action, the keystrokes that are sent may not be valid. If the keystrokes are not valid, the SendKeys action appears not to have run.



RESOLUTION
Set the Wait argument for the SendKeys action to Yes.



Steps to Reproduce Behavior
  Create the following macro named TestMacro:

     Macro: TestMacro --     Action: SendKeys Keystrokes: %FX Wait: No     Action: MsgBox Message: &quot;HELLO WORLD&quot;  Save the macro. Run TestMacro.

The first macro action should quit Microsoft Access. However, the Wait argument is set to No and the message box is activated before the SendKeys action is run. When the keystrokes are processed, they are not valid, and you hear beeping instead. If the Wait argument were set to Yes, the SendKeys action would have completed before moving to the next action, thus quitting Microsoft Access.

Additional query words: key strokes

Keywords: kbprb KB96579

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.