Cuong Servenet > 22-08-18, 01:47 PM
tranthanhan1962 > 22-08-18, 02:18 PM
Public Function Disable_ShiftKey()
Dim db As Database
Dim prp, prptest As Property
On Error GoTo Err_Handler
Set db = CurrentDb
For Each prptest In db.Properties
If prptest.Name = "AllowBypassKey" Then
db.Properties.Delete "AllowBypassKey"
Exit For
End If
Next prptest
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, False, True)
db.Properties.Append prp
db.Properties.Refresh
MsgBox "Disable Shift Key succeeded!", vbInformation
Set db = Nothing
Set prp = Nothing
Err_Exit:
Exit Function
Err_Handler:
MsgBox "Error " & Err.Number & " ! " & Err.Description, vbCritical
Resume Err_Exit
End Function
Public Function Enable_ShiftKey()
Dim db As Database
Dim prp, prptest As Property
On Error GoTo Err_Handler
Set db = CurrentDb
For Each prptest In db.Properties
If prptest.Name = "AllowBypassKey" Then
db.Properties.Delete "AllowBypassKey"
Exit For
End If
Next prptest
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True, True)
db.Properties.Append prp
db.Properties.Refresh
MsgBox "Enable Shift Key succeeded!", vbInformation
Set db = Nothing
Set prp = Nothing
Err_Exit:
Exit Function
Err_Handler:
MsgBox "Error " & Err.Number & " ! " & Err.Description, vbCritical
Resume Err_Exit
End Function