• Disabling Shift key at startup

    Author
    Topic
    #353427

    How do I disable users from being able to access the db container via holding the shift key when a database is started?

    Viewing 2 reply threads
    Author
    Replies
    • #517020

      Tools–>Startup–>Advanced. Uncheck Use Access Special Keys.

      However, you had better have a back door somewhere on a form or in your code so that YOU can get back into it yourself.

      • #517081

        Charlotte,

        I thought this option was meant to stop things such as the F11 key shortcut when the database is open, not the Shift key combination on startup.

        • #517098

          It should do both.

          • #517124

            Any reason for not using AllowBypassKey, other than wanting a way to ensure that the programmer can get in?

            I found this command in both Access 97 and 2000 help files.

            Kiwi44

          • #517125

            Charlotte – No, turning off “Use Access Special Keys” does not disable the shift key. It certainly doesn’t in A97 (I use both it and the AllowByPassKey property a lot). I’m 99% certain it also does not in A2000, but I’d have to double-check to be absolutely certain.

            • #517208

              [Loud sound of hand smacking forehead]!!! You’re quite right. I’ve had startup code standardized for so long that I forgot that was one of the properties I set that way.

    • #517072

      Hmmm – that is what I did (in Access 97), and when I hold the shift key down and start the database, the database container/window still appears.

      • #517080

        Try this, I have this code running from a button in another database to ‘lock’ the target database

        Private Const szDatabaseToControl = “xxx.mde”

        Private Sub Command1_Click()
        Dim db As Database, ws As Workspace
        Set ws = DBEngine.Workspaces(0)
        Set db = ws.OpenDatabase(szDatabaseToControl)

        ChangeProperty db, “AllowBypassKey”, dbBoolean, False
        End Sub
        Function ChangeProperty(dbs As Database, strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
        Dim prp As Property
        Const conPropNotFoundError = 3270

        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

    • #517251

      So does this mean that the shift key cannot be disabled during startup?

      • #517266

        Yes, it can. But you have to do it from code. There isn’t any handy setting to turn the bypass key off. See Andy’s post earlier in the thread for code that will work in either Access 97 or Access 2000 (with a DAO reference set).

    Viewing 2 reply threads
    Reply To: Disabling Shift key at startup

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: