Argh! Disabled all menus in startup

Snowman88

Registered User.
Local time
Yesterday, 23:16
Joined
Apr 4, 2007
Messages
26
Argh! I disabled all the menues in the startup....how do I reverse this? :D
 
hold shift on database open... that should bring up the database window. right click and go to startup.. turn it back on.. unless u did it with code
 
Thanks! :D
 
One solution I have used is to create a form with 2 buttons: on to enable specific startup properties and the other to disable specific properties.

This way if I "lock" myself out of the database, I can easily remedy by "unlocking" with the click of a custom buttion.

One other trick I learned, was is you have disable shortcut keys and menus, you can still get into the code modules by opening a 2nd instance of Access and opening the code modules (Atl+F11) and then opening the database that you've locked yourself out of.

Code:
Option Compare Database

Sub EnableStartupProperties()
    'lock the database
    ChangeProperty "StartupForm", dbText, "frmStartup"
    ChangeProperty "StartupShowDBWindow", dbBoolean, False
    ChangeProperty "StartupShowStatusBar", dbBoolean, False
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    ChangeProperty "AllowFullMenus", dbBoolean, False
    ChangeProperty "AllowBreakIntoCode", dbBoolean, False
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    ChangeProperty "AllowBypassKey", dbBoolean, False
    ChangeProperty "AppTitle", DB_TEXT, "Lamont Technical Database"
    
    
    

End Sub

Sub DisableStartupProperties()
    'unlock the database
    ChangeProperty "StartupForm", dbText, "frmStartup"
    ChangeProperty "StartupShowDBWindow", dbBoolean, True
    ChangeProperty "StartupShowStatusBar", dbBoolean, True
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
    ChangeProperty "AllowFullMenus", dbBoolean, True
    ChangeProperty "AllowBreakIntoCode", dbBoolean, True
    ChangeProperty "AllowSpecialKeys", dbBoolean, True
    ChangeProperty "AllowBypassKey", dbBoolean, True
    
    
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Database, prp As Property
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    If Err = conPropNotFoundError Then  ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
        dbs.Properties.append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function
 

Users who are viewing this thread

Back
Top Bottom