field.properties.append -- Invalid Operation error? 
Author Message
 field.properties.append -- Invalid Operation error?

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



Sat, 20 Apr 2002 03:00:00 GMT  
 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



Sat, 20 Apr 2002 03:00:00 GMT  
 field.properties.append -- Invalid Operation error?
Perhaps you meant to be working with a field in a tabledef object, not
in a recordset?

 -- Andy

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



Sun, 21 Apr 2002 03:00:00 GMT  
 field.properties.append -- Invalid Operation error?
Hooray!  TableDef fixed it right up.  (That, and then reading a little in
Access 97 Developer's Handbook to fix something else I was doing poorly!)

Goal this week:  Read the DAO chapter in the handbook!  (Not that I haven't
tried in the past, I just kept giving up.)

Hey, this is actually starting to make sense!

Thanks all,
Alison



Sun, 21 Apr 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Invalid operation on a BLOB field

2. Invalid Operation Error

3. error 3219: invalid operation

4. Error 40020: Invalid operation at current state.

5. ADO Command Object Error 3711 Invalid Operation

6. Append Property to field woes

7. Append Field Properties

8. Append Chunk Function never appends to memo field

9. Field.Append Error

10. A07: Error on TableDefs.Append: Too many fields

11. Field.Append Error

12. Key field error when appending excel file to access 97 database

 

 
Powered by phpBB® Forum Software