J
John Baker
I am trying to use a function to disable/enable the shift bypass key. I am
using the following function.
My problem is that it works perfectly in one database but not in another and
I am not sure why.
I get an error of type mismatch at the line db.Properties("AllowBypassKey")
= ON_Shift
Can anyone help?
Function DeactiveShift(ON_Shift As Boolean)
On Error GoTo error
Dim db As Database
Dim prop As Property
Set db = CurrentDb()
db.Properties("AllowBypassKey") = ON_Shift
Exit Function
error: ' if not found
If Err = 3270 Then
Set prop = db.CreateProperty("AllowBypassKey", dbBoolean, ON_Shift)
db.Properties.Append prop
Resume Next
Else
MsgBox ("Function de/activate SHIFT not functioning")
Exit Function
End If
End Function
John B
using the following function.
My problem is that it works perfectly in one database but not in another and
I am not sure why.
I get an error of type mismatch at the line db.Properties("AllowBypassKey")
= ON_Shift
Can anyone help?
Function DeactiveShift(ON_Shift As Boolean)
On Error GoTo error
Dim db As Database
Dim prop As Property
Set db = CurrentDb()
db.Properties("AllowBypassKey") = ON_Shift
Exit Function
error: ' if not found
If Err = 3270 Then
Set prop = db.CreateProperty("AllowBypassKey", dbBoolean, ON_Shift)
db.Properties.Append prop
Resume Next
Else
MsgBox ("Function de/activate SHIFT not functioning")
Exit Function
End If
End Function
John B