Office Systems Blog

Joao Livio 2002 - 2008 Portugal

How to Disable (F11 key) Shortcut to database Window?

 
'(c) 2005 João Tito Lívio 
'This code can only be use as a part of an Application and could not be sell
'TIP: Use code in the Autoexec Macro
'USAGE: If DisableSpecialKeys = True then MsgBox"OK"
 
 'To REQUEST a full functional sample please > Click 
 
Option Compare Database
 
Public Function DisableSpecialKeys() As Boolean
On Error GoTo Err_DisableSpecialKeys

Dim db As Database
Dim Prop As Property
Const conPropNotFound = 3270

Set db = CurrentDb()
db.Properties("AllowSpecialKeys") = False
Set db = Nothing

DisableSpecialKeys = True

Exit_DisableSpecialKeys:
    Exit Function

Err_DisableSpecialKeys:
    If Err = conPropNotFound Then
        'If the property doesn't exist, create it
        Set Prop = db.CreateProperty("AllowSpecialKeys", dbBoolean, True)
        db.Properties.Append Prop
        Resume Next
    Else
        MsgBox "Disable did not Work!!"
        DisableSpecialKeys = False
        Resume Exit_DisableSpecialKeys
    End If

End Function

Comments

Joao Livio said:

this is really helpful
# June 17, 2005 4:51 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)