Disable F11 key

alkrm

Registered User.
Local time
Today, 06:01
Joined
Aug 13, 2003
Messages
39
hi there,

does any one knows how to disable the F11 Key ??

thnx in advance
 
I would use the forms KeyDown event. There might be a more global way of doing this. The AutoKeys macro would do it but some people have problems with it. That said, here is how to set up the KeyDown event for each form using Access 97.

The forms Key Preview property must be set to Yes and the KeyCode must be = 0 to prevent that keys normal function from happening, when pressed!

Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    
    Select Case KeyCode
        Case vbKeyF1
            KeyCode = 0
            MsgBox "The F1 key was Pressed"
        Case vbKeyF2
            KeyCode = 0
            MsgBox "The F2 key was Pressed"
        Case vbKeyF11
            KeyCode = 0
            MsgBox "The F11 key was Pressed"
        Case Else
            'MsgBox "No match!" 'testing
    End Select
        
End Sub
Just remove what you do not need.

HTH
 
You could also disable it using the Tools, StartUp menu option. Choosing Advance and then Unchecking the Use Special Keys.

However this disables the Database Window (F11), the Intermediate window and code window function keys also.
 
I am a newbie and cant figure out where to put the code that Ghudson suggested (though at least I am begining to understand it!)

Anyway I tried adding it to the onload of my switchboard and that didnt work, where should I put it?

Thanks in advance
 
go to the form event

paste the code at the form key down event

set the key preview of the form to True

thats it
 

Users who are viewing this thread

Back
Top Bottom