[AccessD] Adding Caption Property

John Skolits askolits at nni.com
Mon Oct 1 10:47:29 CDT 2007


My objective is to simply add a caption to all my table fields.
I'm sure I'm missing something basic here. I went to many archives and all
the solution seemed similar, but it still won't work for me.
Can anyone tell me what's wrong?



Dim dbCurr As Dao.Database, tdf As Dao.TableDef, fld As Dao.Field 
Dim prop As Dao.Property
  
    'Create Table (This Works)
    Set dbCurr = CurrentDb()
    Set tdf = dbs.CreateTableDef("tbl_TEST")

    'Create Field  (This Works)
    Set fld = tdf.CreateField("Test Field" ,dbtext,  255)
    tdf.Fields.Append fld
    
    'Create the CAPTION property. (This line is accepted)    
     Set prop = fld.CreateProperty("Caption", dbText, "Test Caption")

    'Append the property (Breaks Here)
    fld.Properties.Append prop

 
Error: Run-time error '3219' - Invlaid operation.





More information about the AccessD mailing list