Results 1 to 2 of 2
  1. #1
    Join Date
    May 2017

    Unanswered: Access 2010 shift key bypass not working in windows 10

    Hi, I have developed a database using Access 2010 that has code to enable/disable the shift key bypass facility. This all works fine when I open the database in windows 7. But I can't get it to work when I open the database in windows 10. Any help would be appreciated. Many thanks.

    Code as follows:

    '***************** Code Start ***************
    'Copy this function into a new public module.

    Option Compare Database
    Option Explicit

    Public Function SetProperties(strPropName As String, _
    varPropType As Variant, varPropValue As Variant) As Integer

    On Error GoTo Err_SetProperties

    Dim db As DAO.Database, prp As DAO.Property

    Set db = CurrentDb
    db.Properties(strPropName) = varPropValue
    SetProperties = True
    Set db = Nothing

    Exit Function

    If Err = 3270 Then 'Property not found
    Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
    db.Properties.Append prp
    Resume Next
    SetProperties = False
    MsgBox "SetProperties", Err.Number, Err.Description
    Resume Exit_SetProperties
    End If
    End Function
    '***************** Code End ***************
    Once you have created the module, then you will need to attach the following code to a command button (or label, graphic etc.):

    '***************** Code Start ***************
    'Assign this to the OnClick event of a command button (or double-click event
    'of a label or graphic) named "bDisableBypassKey"
    'Change the "TypeYourBypassPasswordHere" default password to your password

    Private Sub bDisableBypassKey_Click()
    On Error GoTo Err_bDisableBypassKey_Click
    'This ensures the user is the programmer needing to disable the Bypass Key
    Dim strInput As String
    Dim strMsg As String
    strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
    "Please key the programmer's password to enable the Bypass Key."
    strInput = InputBox(Prompt:=strMsg, title:="Disable Bypass Key Password")
    If strInput = "TypeYourBypassPasswordHere" Then
    SetProperties "AllowBypassKey", dbBoolean, True
    MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
    "The Shift key will allow the users to bypass the startup & _
    options the next time the database is opened.", _
    vbInformation, "Set Startup Properties"
    SetProperties "AllowBypassKey", dbBoolean, False
    MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
    "The Bypass Key was disabled." & vbCrLf & vbLf & _
    "The Shift key will NOT allow the users to bypass the & _
    startup options the next time the database is opened.", _
    vbCritical, "Invalid Password"
    Exit Sub
    End If
    Exit Sub
    MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
    Resume Exit_bDisableBypassKey_Click
    End Sub
    '***************** Code End ***************

  2. #2
    Join Date
    May 2017


    Hi, I found the answer to this problem. Using Windows 10 the database has to be in a Trusted Folder for the shift bypass code to work. Windows 7 doesn't seem so fussy and will run ok without a Trusted folder.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts