I am trying to append a property to the object Validation rule in the field
branch1 of the table products.I then get the message
"Cannot append. An object with the same name exists in
the collection"
It is true that the object ValidationRule exists in the field.However i want to
make the validation rule to be >0 and i cannot make it.I receive the above error
May i ask for help as to where is in my function ?
Public Function Validate()
Dim dbs As DAO.Database
Set dbs = CurrentDb
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Set tdf = dbs.TableDefs(" products")
Set fld = tdf.Fields("bra nch1")
Set prp = fld.CreatePrope rty("Validation Rule", dbText, ">0")
fld.Properties. Append prp
dbs.Close
Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
Set dbs = Nothing
End Function
branch1 of the table products.I then get the message
"Cannot append. An object with the same name exists in
the collection"
It is true that the object ValidationRule exists in the field.However i want to
make the validation rule to be >0 and i cannot make it.I receive the above error
May i ask for help as to where is in my function ?
Public Function Validate()
Dim dbs As DAO.Database
Set dbs = CurrentDb
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Set tdf = dbs.TableDefs(" products")
Set fld = tdf.Fields("bra nch1")
Set prp = fld.CreatePrope rty("Validation Rule", dbText, ">0")
fld.Properties. Append prp
dbs.Close
Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
Set dbs = Nothing
End Function
Comment