PgDn in UserForm

O

Oskar

I would like to use PgDn in a userform (to execute sub bnNext_Click). Is this trivial? possible

Apparently onkey doesn't work in userforms and accelerator keys can only be letters. Am I right

Oskar
 
V

Vasant Nanavati

Try this (untested):

Private Sub UserForm_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 34 Then bnNext_Click
End Sub

You will also need to put the code in the KeyDown event of any control that
is capable of receiving focus, including bn_Next.
 
V

Vasant Nanavati

Sorry, Oskar; not quite sure how to do that.

--

Vasant


Oskar said:
I take back what I said about "working". OK, I get the next record.
However, the "standard event" is executed too!
I.e. in a combo box I get the new record but with a new value in the combo
box (depending on the number of lines defined for that box).
 
Top