Num Lock turned off when using SendKeys

T

ThomasAJ

Code is:

AppActivate "MYOB Accounting", True
Call DelaySeconds(0.5)
SendKeys "{TAB}", True

It's definately the SendKeys that turns the Num Lock off.
 
J

John W. Vinson

Code is:

AppActivate "MYOB Accounting", True
Call DelaySeconds(0.5)
SendKeys "{TAB}", True

It's definately the SendKeys that turns the Num Lock off.

Yep. This is one of many, many reasons to avoid SendKeys if at all possible.

I don't know if MYOB supports automation, but if it does, use it.

Note that A2007 has, if I understand aright, removed SendKeys altogether.
 
T

ThomasAJ

What a shame Sendkeys has such problems - is it asking MS too much to fix the
problem rather than just can it?

It is invaluable to me:

eg I have to pay someone for work done for company.
I need to update 3 different apps.
1 Mine, 2 Banking payment (actual payment), 3 MYOB.

Without Sendkeys I need to very very carefully make sure I enter the correct
info into all 3. With send keys I have do not have any such worry.

It's ACCURATE and FAST and SIMPLE TO PROGRAM

I LOVE SENDKEYS
 
D

David C. Holley

If I understand the issue correctly, SendKeys literally just sends
keystrokes to the active window. Access cannot determine if the application
in the active window is in a state to receive the keystrokes - like typing
keystrokes on your keyboard, but with the monitor off. Its not a scenario
that MS has control over as every software company out there would have to
build into their application code that confirms the application state.

I would suggest that you're love of SendKeys is only because you're in the
very small minority of persons that's never had adverse problems with it. In
short, you've gotten lucky, but statistically you're headed for a train
wreck.

MS, and many other application developers, do provide a viable means for
working with an application from within another - Automation. It is simply
the ability to access the Object Model of one application from within
another. You've most likely seen posts and code wherein one Office
application uses another to perform an action - such as Access automating
Outlook to generate an email or Outlook reaching out to Access to get
information from a .mdb file for use in an email.
 
D

David C. Holley

Precisely, which is why I think that the original poster is in the very rare
minority that hasn't had problems with it.
 
B

Beetle

As stated in some other responses, SendKeys is not really
recommended, but if you can't find any other alternative
here is a link to a replacement module for SendKeys which may at
least help solve your NumLock problem. The other drawbacks
to SendKeys still apply however.

http://www.mvps.org/access/api/api0046.htm
 
D

David C. Holley

I liked the disclaimer that SendKeys could result in your hard drive being
reformated. The greater the number of variables in a system, the higher the
probablity of catastrophic failure.
 
T

ThomasAJ

I have used it for 5 years now.

At the beginning of each lot of sendkeys (say banking - yes banking - and of
couse I check the $s etc - not once has it been wrong) a message pops of
reminding to put the focus on a particular field - when done I press OK.
Sendkeys fills out the form.

I have used it many 1000s of times and no problem. I put a delay of about
half a sec between sends and no problem.

I use automation for emails in Outlook - cannot be done for other apps like
say banking.
 
T

ThomasAJ

oh I forgot - would I let one of my staff use it the way I do - probably not
- maybe 1.

There that'll make you happy :)
 
D

David W. Fenton

Code is:

AppActivate "MYOB Accounting", True
Call DelaySeconds(0.5)
SendKeys "{TAB}", True

It's definately the SendKeys that turns the Num Lock off.

MYOB provides read/write ODBC drivers, so why not get those (they
are free to registered users of MYOB) and then you won't need
SendKeys at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top