View Full Version : PgUp and PgDown keys.


miki
11-04-2001, 05:33 AM
How I can avoid the record transition when I use PgUp and PgDown keys.
(I have larg and long form and i need use PgUp and PgDown keys to move up and down but avoid the record transition to next or previous)
thanks.


[This message has been edited by miki (edited 11-04-2001).]

R. Hicks
11-04-2001, 05:59 AM
First open your form in design view. In the property list for the form change the "Key Preview" property to Yes (default is No).

Now in the "On Key Down" property of the form, use the following code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
' KeyCode 33 = PgUp, KeyCode 34 = PgDown
If KeyCode = 33 Or KeyCode = 34 Then
* KeyCode = 0
End If
End Sub

HTH
RDH

[This message has been edited by R. Hicks (edited 11-04-2001).]