Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKeys Macro Problem 1

Status
Not open for further replies.

SgtJarrow

Programmer
Apr 12, 2002
2,937
US
I was just about to call my tech support guys and have my keyboard replaced.....but the problem seems to be a Macro with SendKeys command...

Setup:
WinNT
Access97

Situation:
I use a very specific error handling routine that traps almost every error I have ever encountered and gives general error if the specific error is not found. Instead of coding the:

On Error GoTo, et al

in all my procedures and functions, I am currently using the AutoKeys Macro with F12 mapped to a series of SendKeys commands that populates my procedure or function with my error handling data....along with some other stuff.....

What I noticed was my NumLock key seemed to "randomly" turn itself off. I was going to call the tech guys and then I noticed that when I hit the F12 key the NumLock is turned off. I don't see anything in the code that should be doing this.....Converting the code to VBA and having the AutoKeys Macro run this is no help either....Below is the macro converted to VBA for your viewing pleasure.

Any suggestions/alternate methods would be appreciated. Thanks.

========================================================

SendKeys "~", False
SendKeys "'****************************************~", False
SendKeys "'Created By: Robert L. Johnson III~", False
SendKeys "'Mod Date: xx/xx/xxxxe~", False
SendKeys "'Purpose: Enter Purpose~", False
SendKeys "'Usage: Enter Usage~", False
SendKeys "'Output: Enter Output~", False
SendKeys "'****************************************~", False
SendKeys "~", False
SendKeys "On Error GoTo MeError~", False
SendKeys "~~~", False
SendKeys "MeExit:~", False
SendKeys " Exit Sub~{BS}", False
SendKeys "~", False
SendKeys "MeError:~", False
SendKeys " Call ErrorHandler{(}Err.Number{)}~", False
SendKeys "Resume MeExit~{BS}", False
The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
To further elaborate on the problem....it seems to happen when I use any SendKeys commmand....run from the AutoKeys, Immediate Window, called from another procedure....

Anyone seen this? The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
I know this is a few months old, but in case you haven't found the answer- this is a known SendKeys bug (and one I deal with daily.) Here's the Microsoft KB number: Q179987
 
That article shed a little light on the subject.....

By combining all the sendkeys statements into one line, it works........

Thanks kd5oyd. Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Robert,

I don't know the solution MS offers, but Dev has great code on his site that I use for sendkeys becuase of this bug.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Jeremy.....

Tried it, but it still did not specifically meet my requirements. I finally got this working exactly as I want it. But thanks. Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top