Option Compare Database Option Explicit Public Function SetProperties(strPropName As String, _ varPropType As Variant, varPropValue As Variant) As Integer On Error GoTo Err_SetProperties Dim db As DAO.Database, prp As DAO.Property Set db = CurrentDb db.Properties(strPropName) = varPropValue SetProperties = True Set db = Nothing Exit_SetProperties: Exit Function Err_SetProperties: If Err = 3270 Then 'Property not found Set prp = db.CreateProperty(strPropName, varPropType, varPropValue) db.Properties.Append prp Resume Next Else SetProperties = False MsgBox "SetProperties", Err.Number, Err.Description Resume Exit_SetProperties End If End Function