John Skolits
askolits at nni.com
Mon Oct 1 13:58:44 CDT 2007
Yes, I did try that. I have found that the problem is that you must append the table first to the tables collection, before you can add the property. That's weird since all the examples I have found seemed to indicate you could do it while building the table. Well, I finally figured it out. Thanks, John -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: Monday, October 01, 2007 1:53 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Adding Caption Property 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 > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com