[AccessD] Append properties to a new field

Andy Lacey andy at minstersystems.co.uk
Wed Sep 13 02:13:32 CDT 2006


David,
Broadly speaking it's like this (lifted from the Backend Updater which you
might find useful, see
http://www.databaseadvisors.com/downloads.htm )

Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property


Set tdf = db.TableDefs("Tablename")			'assumes db already
set of course
Set fld = tdf.Fields("FldName")

Set prp = fld.CreateProperty("Description")
prp.Type = dbText
prp.Value = "This is description"
fld.Properties.Append prp

Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing

Cheers

-- Andy Lacey
http://www.minstersystems.co.uk 

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Gray
> Sent: 12 September 2006 23:37
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Append properties to a new field
> 
> 
> Hi,
> 
> Would anyone have some code to create properties for a newly 
> created field in a table def using DAO.
> 
> My code allows me to create properties for an existing field 
> but if i try to test for the existence of a property in the 
> newly created and appended field my error handler which will 
> handle error 3270 'Property not found' stops working and I 
> get the error message error 3270 'Property not found'. I am 
> refreshing the Fields collection after appending the field.
> 
> Thanks in advance
> 
> David Gray
> 96 Springacre Rd
> Thornlands QLD
> Yahoo ID: flock_it_software
>  
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 





More information about the AccessD mailing list