How to disable Page Up / Down keys

Doppenberg

Registered User.
Local time
Today, 18:54
Joined
May 25, 2000
Messages
25
Can anyone tell me how I can disable the Page Up and Page Down keys.

When I Press them my windows moves a little bit up an down (about 0,5 cm) and sometimes it even move to a new record in my form.
This cannot be possible. In the previous form I selected a customer to edit and now, when I am in the "Edit-Form" I can Add a customer by pressing the PAGE DOWN key !

Is it possible to disable those keys ?

Thanks, Tim.
 
Go into your forms property and set the "Cycle" to CURRENT RECORD only.
 
Yes, you can disable the PageUp/PageDown Keys on the form.

Set the Forms Key Preview to True. Add code to the KeyPress Event that when the KeyAscii = 43 or 42 (I think these are the values) that you reset them to 0. All other keys are ok.

Now the going to a blank record when you are editing is a seperate issue but you can easily fix it by setting the AllowAdditions property to False (You can do this in code if this form is being use for Edits and Adds)

Hope this helps.

Just a note: The Cycle this record property only contains the Enter/Tab keypresses the PageUp/PageDown are not limited by this rule.

[This message has been edited by Travis (edited 05-27-2000).]
 
Thanks Travis, your solution worked almost. I found the right code on the MS Knowledge Base.
This is the correct code:


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case 33, 34
KeyCode = 0
End Select

End Sub


Anyway, Thanks for your help.

Tim.

[This message has been edited by Doppenberg (edited 05-31-2000).]

[This message has been edited by Doppenberg (edited 05-31-2000).]
 

Users who are viewing this thread

Back
Top Bottom