Keypressed

I'd like to catch the hit key in a vbform composed by several text boxes, combo boxes wherever the focus is.

For example: there is a text box to show a code and there is a text box to show the name of the product. If want my user to press insert to open a new form for adding a product wherever the focus is set (the T_code or the T_Libelle).

Thanks
PleinpopossumAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
deightonConnect With a Mentor Commented:
form.keypreview = true

then in the form_keydown event look for keycode = 45
0
 
deightonCommented:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'need formKeyPreview = true

If KeyCode = 45 Then

 Form2.Show
   
End If


End Sub
0
All Courses

From novice to tech pro — start learning today.