How to disable pageup/pagedown in a form so users can't browse records

D

David Kistner

I have a data entry form that I need to limit functionality so that
users cannot browse other records with the form. I think I have
everything disabled except for the pageup and pagedown keys still allow
a user to browse records. How do I disable this? Thanks in advance.

- David Kistner
 
S

StCyrM

Good morning

The following code should help


Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
' If user presses TAB, ENTER, PAGE UP, PAGE DOWN
Case 13, 9, 33, 34
' Disable the keystroke by setting it to 0
KeyCode = 0
Case Else

Debug.Print KeyCode, Shift
End Select
End Sub


Best Regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
 
D

David Kistner

Where do I place the code? I've never worked with code in Access.
Thank you very much in advance.

- David Kistner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top