Disable Page up/Page down keys not working...

pablavo

Registered User.
Local time
Today, 13:22
Joined
Jun 28, 2007
Messages
189
HI everyone.

I was looking for some code to disable the Pageup/down keys within a form and the code I got is not working.

first of all, I used the 'Cycle' property of the form to 'Current record' I also added this code:

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

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

End Sub

This didn't work and the forms records still move when the two Keys are pressed

Does anyone have an idea what i might be doing wrong?
thanks:confused:
 
HI everyone.

I was looking for some code to disable the Pageup/down keys within a form and the code I got is not working.

first of all, I used the 'Cycle' property of the form to 'Current record' I also added this code:

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

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

End Sub

This didn't work and the forms records still move when the two Keys are pressed

Does anyone have an idea what i might be doing wrong?
thanks:confused:

Hello

I will refer you to the sample database I posted several years ... I know that this one works

http://www.access-programmers.co.uk/forums/showthread.php?t=105598

Best regards

Maurice
 
thanks Maurice. You had the same code that I tried and yours did work and mine did not. So, I had a look at your properties and saw that the 'Key Preview' was set to yes and when I did that it worked fine.

Thanks again.
 
Hello

Glad to be of service..

Best regards

Maurice
 

Users who are viewing this thread

Back
Top Bottom