Message 1 of 8
KeyDown-KeyUp, how do I make it work on a form?

Not applicable
06-04-2002
04:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How in the world do I get a VBA UserForm to acceppt KeyDown and KeyUp, I
can get the following to work in text boxes but not on the form:
NO WORKY:
Private Sub UserForm_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
msgbox KeyCode
End Sub
YES WORKY:
Private Sub txtBoxIamHere_KeyDown(ByVal KeyCode As_
MSForms.ReturnInteger, ByVal Shift As Integer)
msgbox KeyCode
End Sub
any ideas?
I know this is VBA and in VB I think I might ise keypreview or similar to
sniff out keys. any ideas?
thanks joseguia
can get the following to work in text boxes but not on the form:
NO WORKY:
Private Sub UserForm_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
msgbox KeyCode
End Sub
YES WORKY:
Private Sub txtBoxIamHere_KeyDown(ByVal KeyCode As_
MSForms.ReturnInteger, ByVal Shift As Integer)
msgbox KeyCode
End Sub
any ideas?
I know this is VBA and in VB I think I might ise keypreview or similar to
sniff out keys. any ideas?
thanks joseguia