Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Page Down key

Status
Not open for further replies.

JillT

Programmer
Oct 29, 2001
13
GB
Has anyone got any idea how to disable the Page Down key so a user doesn't go to a new record on a form if they hit it please?
 
Try an Event Procedure in the form's On Key Down event, something like:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = 33 Or KeyCode = 34) And Shift = 0 Then KeyCode = 0
End Sub
Note that 34 traps the PageDown key, and 33 traps the PageUp key, as I'm assuming you also want to catch this.

[pc2]
 
Hi mp9. Thanks for that code. However, sorry to say it doesn't work for me, I still go to a blank record if I press page down. I have some workarounds, but it seemed such a simple thing to do!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top