dmorgan20
dmorgan20

Reputation: 363

Disable SpecialKeys

Afternoon

I am looking to disable special keys such as CTRL+Break, F11 etc.

The code below is in a macros which is my AutoExec - It doesn't debug but also doesn't seem to work at all:

Any help is appreciated

Code:

Dim prp As DAO.Property
Set db = CurrentDb()
Select Case X
    Case 1
    Set prp = db.CreateProperty("StartUpShowDBWindow", 1, 1)
        db.Properties.Append prp
    Case 2
    Set prp = db.CreateProperty("AllowBreakIntoCode", 1, 1)
        db.Properties.Append prp
    Case 3
    Set prp = db.CreateProperty("AllowSpecialKeys", 1, 1)
        db.Properties.Append prp
    Case 4
    Set prp = db.CreateProperty("AllowToolbarChanges", 1, 1)
        db.Properties.Append prp
    Case 5
    Set prp = db.CreateProperty("AllowFullMenus", 1, 1)
        db.Properties.Append prp
    Case 6
    Set prp = db.CreateProperty("AllowBuiltInToolbars", 1, 1)
        db.Properties.Append prp
    Case 7
    Set prp = db.CreateProperty("AllowByPassKey", 1, 1)
        db.Properties.Append prp
    Case Else
    'do nothing

Upvotes: 0

Views: 684

Answers (1)

Erik A
Erik A

Reputation: 32642

These properties are loaded before the AutoExec macro fires, and set for the next startup. You need to restart your database before they take effect.

Furthermore, they are boolean properties, which means: db.CreateProperty("StartUpShowDBWindow", 1, False), not db.CreateProperty("StartUpShowDBWindow", 1, 1) if you want to disable certain functionality.

Upvotes: 1

Related Questions