Vbkey Question

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
 
A

Allen Browne

Use the KeyDown event of the form. KeyPress is only good for character keys.

Make sure the form's KeyPreview property is Yes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top