troubleshooting Question

Can KeyDown be coded for Access application-wide or just on each form?

Avatar of Sonny G
Sonny G asked on
Microsoft AccessVBA
11 Comments1 Solution13 ViewsLast Modified:
On each form I have the following sub:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
 '***********************
 '* Ignore function keys *
 '***********************
    Select Case KeyCode
        Case vbKeyPageUp
            KeyCode = 0
        Case vbKeyPageDown
            KeyCode = 0
        Case vbKeyPageDown
            KeyCode = 0
        Case vbKeyF1
            KeyCode = 0
        Case vbKeyF2
            KeyCode = 0
        Case vbKeyF3
            KeyCode = 0
        Case vbKeyF4
            KeyCode = 0
        Case vbKeyF5
            KeyCode = 0
        Case vbKeyF6
            KeyCode = 0
        Case vbKeyF7
            KeyCode = 0
        Case vbKeyF8
            KeyCode = 0
        Case vbKeyF9
            KeyCode = 0
        Case vbKeyF10
            KeyCode = 0
        Case vbKeyF11
            KeyCode = 0
        Case vbKeyF12
            KeyCode = 0
        Case vbKeyPageUp
            KeyCode = 0
        Case vbKeyPageDown
            KeyCode = 0
    End Select
End Sub

Is it possible to place a variation of this code in a global module that would affect all forms throughout the entire application?

Thanks, in advance, for your guidance.


ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros