Vbkey Question

  • Thread starter Thread starter Tig
  • Start date Start date
T

Tig

Hi,

For some reason, my form trigger is not firing when vbdown is pressed.
If i press any other keys the msgbox shows up.

The cursor would move down but no trigger will be fired. Same with all the
arrow keys.

I thought vbkeydown can capture the down arrow key ... I am using a non-US
keyboard.

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyDown Then
MsgBox "key down"
End If
msgbox "tiggered"
End Sub
 
Use the KeyDown event of the form. KeyPress is only good for character keys.

Make sure the form's KeyPreview property is Yes.
 
Back
Top