Shift key, alt key and control key mask : Key « Access « VBA / Excel / Access / Word






Shift key, alt key and control key mask

 

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 
    Select Case Shift 
        Case acShiftMask 
            MsgBox "You pressed the SHIFT key." 
        Case acCtrlMask 
            MsgBox "You pressed the CTRL key." 
        Case acAltMask 
            MsgBox "You pressed the ALT key." 
    End Select 
End Sub 

 








Related examples in the same category

1.Writing the Form_KeyDown Event Procedure
2.Writing the Form_KeyUp Event Procedure
3.Writing the Form_KeyPress Event Procedure
4.Arrow key, page up, page down key
5.Check the keycode