Sendkeys to application

GRose

Registered User.
Local time
Today, 01:23
Joined
Mar 4, 2004
Messages
21
I am using Access 97 and a windows based program. I want to automate some input in to the program using sendkeys which works fine until it comes to a certain part. You have to press NUM LOCK to toogle a mode (like shift), then END (to display a menu) and then UP twice (to get the the option needed). Trouble is, it displays 188 (1 is end and up is 8 on the num part of the keyboard. Is there any other way of sending NUMLOCK, END and UP?

The code I am using is:

Private Sub Command0_Click()
DoEvents
AppActivate "KEA! 420 - FINANCE"
SendKeys "{ENTER}", True
SendKeys 2 & "{ENTER}", True
SendKeys 8 & "{ENTER}", True
SendKeys "{NUMLOCK}", True
SendKeys "{END}", True
SendKeys "{UP 2}", True
End Sub


Ta.
 
There has to be a better way than sending keys, explain what each part is doing, you could probably just use "better" vba to do what you want.
________
Colorado Dispensaries
 
Last edited:
Private Sub Command0_Click()
DoEvents
AppActivate "KEA! 420 - FINANCE" - switching to the application
SendKeys "{ENTER}", True - pressing enter to go to the first option that is highlighted
SendKeys 2 & "{ENTER}", True - goes to option 2 and then enter to open it
SendKeys 8 & "{ENTER}", True - goes to option 8 and then opens it
SendKeys "{NUMLOCK}", True - you have to press numlock to switch to secondary key mode
SendKeys "{END}", True - you press END to bring up another menu
SendKeys "{UP 2}", True - you press the up arrow twice to go to the correct option.
End Sub

All i need is a way of using NUMLOCK and END and I am there. Is there any other reference that can be used for those keys?

Thanks.
 

Users who are viewing this thread

Back
Top Bottom