ineedyourhelp
MIS
I would like to disable all of the F keys, in particular the F1, F7 and F12 keys. I have tried the code (see below), but it is not working properly. I'm not sure whether or not to use the code on the KeyPress or KeyDown Event. If I decide to use the OnKeyPress, I would need the Ascii code for the F keys. I have found Ascii code maps online, but I'm just not sure which code to use.
Here is the code I tried on On KeyDown..... No luck...
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If ((KeyCode = vbKeyF12) Or (KeyCode = vbKeyF7)) Then
KeyCode = 0
End If
End Sub
Here is the On KeyPress that I tried, but I don't know what to plug in for the F key Ascii codes.
Private Sub Form_KeyPress(KeyAscii As Integer)
If ((KeyAscii = ??) Or (KeyAscii = ??)) Then
KeyAscii = 0
End If
End Sub
Would either of these methods work, or am I going in the wrong direction with this? I have read about setting up Macros to trap these functions, but I would rather stay away from Macros if possible.
Here is the code I tried on On KeyDown..... No luck...
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If ((KeyCode = vbKeyF12) Or (KeyCode = vbKeyF7)) Then
KeyCode = 0
End If
End Sub
Here is the On KeyPress that I tried, but I don't know what to plug in for the F key Ascii codes.
Private Sub Form_KeyPress(KeyAscii As Integer)
If ((KeyAscii = ??) Or (KeyAscii = ??)) Then
KeyAscii = 0
End If
End Sub
Would either of these methods work, or am I going in the wrong direction with this? I have read about setting up Macros to trap these functions, but I would rather stay away from Macros if possible.