Andy Lacey
andy at minstersystems.co.uk
Mon Oct 1 12:53:02 CDT 2007
Hi John
Have you tried?
Set prop = fld.CreateProperty("Caption")
prop.Type=dbText
prop.Value="Test Caption"
fld.Properties.Append prop
-- Andy Lacey
http://www.minstersystems.co.uk
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> John Skolits
> Sent: 01 October 2007 16:47
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Adding Caption Property
>
>
> 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.
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>