[AccessD] Adding property to table field

David Emerson newsgrps at dalyn.co.nz
Fri Feb 4 07:57:37 CST 2005


Thanks Gustav,  that did the trick.

David

At 4/02/2005, you wrote:
>Hi David
>
>Try with
>
>   CreateProperty("DecimalPlaces", dbByte, 2)
>
>/gustav
>
> >>> newsgrps at dalyn.co.nz 04-02-2005 06:26:15 >>>
>Group,
>
>A97.  Here is my code:
>
>      Dim dbsBE As Database, tbldef As TableDef, fld As Field
>
>      Set dbsBE =
>DBEngine.Workspaces(0).OpenDatabase(DLookup("DataDirectory", "Variables
>
>Setup"))
>
>      Set tbldef = dbsBE.TableDefs("Variables")
>      'create the fields
>      Set fld = tbldef.CreateField("AnnualReturnCA11", dbSingle)
>      tbldef.Fields.Append fld
>
>      fld.Properties.Append fld.CreateProperty("Format", dbText,
>"Percent")
>      fld.Properties.Append fld.CreateProperty("DecimalPlaces", dbText,
>"2")
>      fld.Properties("DefaultValue").Value = 0
>
>This all works except the DecimalPlaces property shows "Auto" in the
>table
>(and not 2).  I have tried
>      fld.Properties.Append fld.CreateProperty("DecimalPlaces",
>dbInteger, 2)
>but this also doesn't work.
>
>Any suggestions?
>
>
>Regards
>
>David Emerson
>Dalyn Software Ltd
>25 Cunliffe St, Churton Park
>Wellington, New Zealand
>Ph/Fax (04) 478-7456
>Mobile 027-280-9348
>
>--
>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