Full Version: Holding down a button while clicking...
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
lukesb
Hi Everyone

Is there a way to tell if a user has held down, say the Ctrl key (I am assuming it will be pretty much the same whatever key I wish to trap for), when they have clicked on a control on a form..?

Cheers

Luke
MDM_Inc
On the 'Mouse Down' event there is a parameter called 'Shift' that contains the value of the key that was held down while the user mouse clicked.

Here's the text from the help page:
Shift The state of the SHIFT, CTRL, and ALT keys when the button specified by the Button argument was pressed or released. If you need to test for the Shift argument, you can use one of the following intrinsic constants as bit masks:
Constant Description
acShiftMask The bit mask for the SHIFT key.
acCtrlMask The bit mask for the CTRL key.
acAltMask The bit mask for the ALT key.


Alan
lukesb
Nice one Alan, that's just what I needed...

Cheers mate

thumbup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.