Shift key protection not working

  • Thread starter Thread starter Bisha
  • Start date Start date
B

Bisha

This is very strange. I have used this code for disabling Shift Key to
bypass startup succesfully
but when i try it now it's not working. Please somebody help ...

This is the code I use .


Sub Protect()
Const DB_Boolean As Long = 1
ChangePropertyDdl "AllowBypassKey", DB_Boolean, False
End Sub


Function ChangePropertyDdl(stPropName As String, _
PropType As DAO.DataTypeEnum, vPropVal As Variant) _
As Boolean
On Error GoTo ChangePropertyDdl_Err
Dim db As DAO.Database
Dim prp As DAO.Property
Const conPropNotFoundError = 3270
Set db = CurrentDb
db.Properties.Delete stPropName
Set prp = db.CreateProperty(stPropName, _
PropType, vPropVal, True)
db.Properties.Append prp
ChangePropertyDdl = True

ChangePropertyDdl_Exit:
Set prp = Nothing
Set db = Nothing
Exit Function

ChangePropertyDdl_Err:
If Err.Number = conPropNotFoundError Then
Resume Next
End If
Resume ChangePropertyDdl_Exit
End Function
 
Back
Top