Hey guys,
Following is my code to disable the shft key. In the past it has worked on other forms but just doesn't want to work on the back end Db. Here is the code
This is how i call it in VB:
When i click on it it gives me the following error 'Runtime error 3259, invalid field data type'
Any help will be great! Thanks
Following is my code to disable the shft key. In the past it has worked on other forms but just doesn't want to work on the back end Db. Here is the code
This is how i call it in VB:
Code:
Private Sub Disable_Click()
Const DB_Boolean As Long = 0
ChangeProperty "AllowBypassKey", 0, False
End Sub
When i click on it it gives me the following error 'Runtime error 3259, invalid field data type'
Code:
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
'============================================================
' Purpose: To enable/disable bypass key
' Company: AirSep Corporation
' Programmer: Shlagha Jain
' Date: 12/01/07
'============================================================
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
Any help will be great! Thanks