The information in this article applies to:
SUMMARY
Moderate: Requires basic macro, coding, and interoperability skills.
MORE INFORMATIONMethod 1: Opening the Form as Dialog Using the OpenForm Macro ActionThe PAGE UP and PAGE DOWN keys will be inoperative in a form if the form is opened using an OpenForm macro action with the Window Mode argument set to Dialog. To demonstrate this technique, create and run a new macro with the following actions in the sample database NWIND.MDB.
The drawback to this technique is that a Dialog form cannot use a custom menu, nor will you be able to switch to another form while the Dialog form is open. NOTE: The Microsoft Access Wizards use this technique to limit navigation in multiple-page forms. Method 2: Trapping PAGE UP and PAGE DOWN in the KeyDown EventThe PAGE UP and PAGE DOWN keys can be detected and trapped in a control by adding the following lines of Access Basic code to the KeyDown event for all the controls on a form where the PAGE UP and PAGE DOWN keys should be disabled:
NOTE: The constants for KeyCode are defined in the CONSTANT.TXT file, which is included with Microsoft Access. To use these constants in your code, you must either declare them yourself or copy them from the CONSTANT.TXT file and paste them into the Declarations section of your module. The following example demonstrates how to detect and trap the PAGE UP and PAGE DOWN keys in a control's KeyDown event. CAUTION: Following the steps in this example will modify the sample database NWIND.MDB. You may want to back up the NWIND.MDB file, or perform these steps on a copy of the NWIND database.
REFERENCES
For more information about disabling PAGE UP and PAGE DOWN in Microsoft
Access 95 and 97, please see the following article in the Microsoft
Knowledge Base:
Additional query words: pgup pgdn
Keywords : kbusage FmsOthr |
Last Reviewed: April 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |