Hi friend,
I received this message "Property not found" to the following function with Red color.
Public Function SetAppProp(prpName As String, prpType As Integer, prpValue)
Dim prp As Property
Const conPropNotFoundError = 3270
On Error GoTo SetAppProp_Err
CurrentDb.Properties(prpName) = prpValue
SetAppProp_Bye:
Exit Function
SetAppProp_Err:
If Err = conPropNotFoundError Then
CurrentDb.Properties.Append CurrentDb.CreateProperty(prpName, prpType, prpValue)
Set prp = Nothing
Resume Next
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description, vbCritical
Resume SetAppProp_Bye
End If
End Function
Public Function GetAppProp(prpName As String) As Variant
On Error GoTo GetAppProp_Err
GetAppProp = Null
Const conPropNotFoundError = 3270
GetAppProp = CurrentDb.Properties(prpName)
GetAppProp_Bye:
Exit Function
GetAppProp_Err:
If Err = conPropNotFoundError Then
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description, vbCritical
End If
Resume GetAppProp_Bye
End Function
Can somebody help me to solve this problem.
Best regards,
I received this message "Property not found" to the following function with Red color.
Public Function SetAppProp(prpName As String, prpType As Integer, prpValue)
Dim prp As Property
Const conPropNotFoundError = 3270
On Error GoTo SetAppProp_Err
CurrentDb.Properties(prpName) = prpValue
SetAppProp_Bye:
Exit Function
SetAppProp_Err:
If Err = conPropNotFoundError Then
CurrentDb.Properties.Append CurrentDb.CreateProperty(prpName, prpType, prpValue)
Set prp = Nothing
Resume Next
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description, vbCritical
Resume SetAppProp_Bye
End If
End Function
Public Function GetAppProp(prpName As String) As Variant
On Error GoTo GetAppProp_Err
GetAppProp = Null
Const conPropNotFoundError = 3270
GetAppProp = CurrentDb.Properties(prpName)
GetAppProp_Bye:
Exit Function
GetAppProp_Err:
If Err = conPropNotFoundError Then
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description, vbCritical
End If
Resume GetAppProp_Bye
End Function
Can somebody help me to solve this problem.
Best regards,