Is the ShiftKey down

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a small subform. I want to tab out of the last field to the next
logical field on the parent. BUT, if the shiftkey is down, then I want to
move to the next previous field on the subform.

Is there any way to say "If the shift key is not down then do something"

This way, if the Shift Key is down, I know I am doing a Shift-Tab and let it
go, but if the Shift Key is not down, I can set the focus to the next logical
field on the parent.
 
Attach this to the keydown event of the 'last field'....

Private Sub txtCtl_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
If Shift = 1 Then
'shift+tab pressed
Else
'shift pressed
End If
End If
End Sub
 
Back
Top