T
TNL
Hi,
I use DAO to change structure of a table:
I add a new field with type: single. Now I want to define the format and
DecimalPlaces property of this field to "fixed" and 2.
In Access (2000) I can access these property with number 24, 25:
?currentdb.TableDefs("Output").Fields("Tax1").Properties(24).name
?currentdb.TableDefs("Output").Fields("Tax1").Properties(24).value
But these properties don't exist (for a new field, that created with DAO,
I'm not sure).
I think, I must create these properties and add to collection Properties. My
code is following, but doesn't work, I don't know, why.
Set tdf = db.TableDefs("Output")
Set fld = tdf.CreateField("Tax1", DAO.DataTypeEnum.dbSingle)
fld.DefaultValue = 0
Dim prop As DAO.Property
Set prop = fld.CreateProperty("Format", , "Fixed")
fld.Properties.Append prop
tdf.Fields.Append fld
Why?
Thanks
TNL
I use DAO to change structure of a table:
I add a new field with type: single. Now I want to define the format and
DecimalPlaces property of this field to "fixed" and 2.
In Access (2000) I can access these property with number 24, 25:
?currentdb.TableDefs("Output").Fields("Tax1").Properties(24).name
?currentdb.TableDefs("Output").Fields("Tax1").Properties(24).value
But these properties don't exist (for a new field, that created with DAO,
I'm not sure).
I think, I must create these properties and add to collection Properties. My
code is following, but doesn't work, I don't know, why.
Set tdf = db.TableDefs("Output")
Set fld = tdf.CreateField("Tax1", DAO.DataTypeEnum.dbSingle)
fld.DefaultValue = 0
Dim prop As DAO.Property
Set prop = fld.CreateProperty("Format", , "Fixed")
fld.Properties.Append prop
tdf.Fields.Append fld
Why?
Thanks
TNL