Function Changeproperty(Strpropname As String, Varproptype As Variant, Varpropvalue As Variant) As Integer
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