
field.properties.append -- Invalid Operation error?
Somebody correct me if I'm wrong, but I don't think you can append a
user-defined property to a recordset field because it's not persistent.
Instead, try to use a tabledef's field (air code):
dim db as database
Dim tdf as tabledef, fld As Field, prp As Property
set db=currentdb
Set tdf = CurrentDb.tabledefs("TableName")
Set fld = tdf!SubCode14
Set prp = fld.CreateProperty("Caption", dbText, "My Caption")
fld.Properties.Append prp
Quote:
> I would swear this was working earlier today, but perhaps I lost a step
> somewhere? The following code gives me an error (Invalid Operation) at the
> Append line. Any hints as to what I'm doing wrong?
> Thanks!
> Alison
> Dim rs As Recordset, fld As Field, prp As Property
> Set rs = CurrentDb.OpenRecordset("TableName")
> Set fld = rs!SubCode14
> Set prp = fld.CreateProperty("Caption", dbText, "My Caption")
> fld.Properties.Append prp