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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoKeys using Keypad? How to reference? 1

Status
Not open for further replies.

boxboxbox

Technical User
Apr 22, 2003
108
US
I'm using an AutoKeys macro, and I want to use Ctl-1 to call a piece of code, but I want to be able to use the number 1 from the keypad. This is not recognized.

Is it possible to use the keypad to call an AutoKeys macro? If so, what syntax do I use?

Thanks.
 
This is what will go in the MacroName column
^1

Then you have to select an Action.

I'm using A2003 and the that AutoKey combination in the macro ran a message box for me.

Paul

 
As a matter of interest, I tested exactly the same autokeys macro in Access 2000, and it does not work with the numeric keypad, only with the keyboard numbers.
 
Seems that that is the case in 2003 as well. It never occured to me to test it using the numeric keypad.
Sorry if that was what you were actually looking for.

Paul
 
Yes, I meant the numeric keypad, which I prefer. I'm also using 2003.

At least in SendKeys (I'm not sure about AutoKeys), you can use the plus and minus keys, but I guess not the numbers themselves, which seems silly. Oh well.

Thanks very much for your efforts!
 
If this is to trap globally, then I don't know, but if it's from within forms, you could trap through some of the key events of the form. With KeyPreview set to yes, try the following in the on keydown event of the form:

[tt]if ((shift and acctrlmask) > 0) then
if (keycode = vbkey1) then
msgbox "ordinary 1"
end if
if (keycode = vbkeynumpad1) then
msgbox "numpad 1"
end if
end if[/tt]

Roy-Vidar
 
Thanks. I'll try it this week when I get back to work.
 
That works great, Roy-Vidar - thank you very much!
 
And remember that the Num Lock has to be on for this to work!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top