View Full Version : Keyup event


Rosebud
01-26-2001, 06:44 AM
I'm trying to use the keyup event to detect that if CTL + Apostrophe were pressed at the same time, to tab the focus to the next control. But when I use the keyup event, the event runs and only one keycode is present, the one for APOSTROPHE. How do I get the keycode to read a combination of keys pressed?

Appreciate any help anyone can give me.

ntp
01-26-2001, 08:18 AM
Try something like this:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim boolCtrlDown As Boolean

boolCtrlDown = (Shift And acCtrlMask) > 0
If (boolCtrlDown = True) And (KeyCode = 17) Then
MsgBox "ctrl + ` pressed"
End If
End Sub

ntp