Hi. This is driving me nuts. I've written a small routine to update users' tables by adding some new fields to their existing tables. My code iterates through the CurrentDb's tables collection, compares each table, field by field, with a remote table's fields. If the remote table is missing one of the local (CurrentDb) fields, the code appends the field to the remote table. I set the field name, type, size when I create the (identical) field in the remote table. This works fine.
However, I cannot find a way to "copy" the source (local, CurrentDb) table field's _Description_ to the remote table. I finally was able to extract the local table's field's Description property (I think it was fld.properties.Item("Description").Value) but I cannot get this simple value assigned to another table/field in the remote table! I've tried the excellent Allen Browne resource
http://allenbrowne.com/func-DAO.html#SetFieldDescription), using:
obj.Properties.Append obj.CreateProperty(strPropertyName, intType, varValue)
but the code simply runs this line, produces no error, and does not append a new property to my field. I've rewritten the lines a dozen different ways, but it just won't set the remote table field property (just Description; the others are assigned fine). Not sure what I'm doing wrong. If anyone can help, I'd sure appreciate it. Thanks.
Thooom
However, I cannot find a way to "copy" the source (local, CurrentDb) table field's _Description_ to the remote table. I finally was able to extract the local table's field's Description property (I think it was fld.properties.Item("Description").Value) but I cannot get this simple value assigned to another table/field in the remote table! I've tried the excellent Allen Browne resource
obj.Properties.Append obj.CreateProperty(strPropertyName, intType, varValue)
but the code simply runs this line, produces no error, and does not append a new property to my field. I've rewritten the lines a dozen different ways, but it just won't set the remote table field property (just Description; the others are assigned fine). Not sure what I'm doing wrong. If anyone can help, I'd sure appreciate it. Thanks.
Thooom