title: Disable bypass key in Access
body: <p>I am trying to disable the shift key option to unhide all the objects in my database. I have tried many different variations of code and none seem to work. Could this be because I am working in a .ACCDB database or is something wrong with my code? I have provided the code below.</p>
  
  <p>Thanks!</p>
  
  <pre><code>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_SetProperties:
  Exit Function
  
  Err_SetProperties:
  If Err = 3270 Then    'Property not found
      Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
      db.Properties.Append prp
      Resume Next
  Else
      SetProperties = False
      MsgBox "SetProperties", Err.Number, Err.Description
      Resume Exit_SetProperties
  End If
  </code></pre>