ACC: Disable PAGE UP and PAGE DOWN Keys in a Form (95/97)ID: Q132031
|
Moderate: Requires basic macro, coding, and interoperability skills.
This article describes how you can disable the PAGE UP and PAGE DOWN keys
in a form by using the new KeyPreview property of forms that was introduced
in Microsoft Access 7.0.
NOTE: This article explains a technique demonstrated in the sample
files, FrmSampl.exe (for Microsoft Access for Windows 95 version 7.0)
and FrmSmp97.exe (for Microsoft Access 97). For information about how
to obtain these sample files, please see the following articles in the
Microsoft Knowledge Base:
Q150895 ACC95: Microsoft Access Sample Forms Available on MSL
Q175066 ACC97: Microsoft Access 97 Sample Forms Available on MSL
To disable the PAGE UP and PAGE DOWN keys in a form, follow these steps:
KeyPreview: Yes
OnKeyDown: [Event Procedure]
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33, 34
KeyCode = 0
End Select
End Sub
Case 27, 33, 34
Keywords : FmsHowto
Version : 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: April 27, 1999