By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

append property

P: n/a
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("branch1")
Set prp = fld.CreateProperty("ValidationRule", dbText, ">0")
fld.Properties.Append prp
dbs.Close
Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
Set dbs = Nothing
End Function
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Johm wrote:
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

If the ValidationRule property already exists, cannot you simply assign
to it? like

fld.ValidationRule = ">0"

?

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.