Cậu này hay nghịch máy tính quá ta, nhưng phải như vậy mới thành tài được
cái này anh sưu tầm thôi thử thử nha
' Function disables shift key
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
' Function enables shift key
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
(sưu tầm )