Link to home
Start Free TrialLog in
Avatar of marku24
marku24Flag for United States of America

asked on

Trigger code in MS Access 2007 if two keys are pressed simultaneously

I would like to trigger some admin options to run in VBA when a combination of keys are pressed at the same time.  How can I code the condition for two keys simultaneously pressed?
Avatar of thenelson
thenelson

If the combination is some key with control, shift or alt then key down or key up will handle this nicely. The KeyCode argument will contain the key, the Shift argument will contain the control, shift and alt combinations.

If you want to capture two key codes like "a" and "i" together, then you would need to capture the keyboard interrupt directly which I don't think is possible with VBA.
Avatar of marku24

ASKER

Thanks , really helpful.  Woudl you have an example of how to use KeyCode with Shift or Alt?  I googled but am having a problem getting it to work.
ASKER CERTIFIED SOLUTION
Avatar of thenelson
thenelson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial