DecimalPlaces Property

  • Thread starter Thread starter James Napolitano
  • Start date Start date
J

James Napolitano

Is their a way to set the DecimalPlaces property in code
when appending a field object?
Thanks.
 
James said:
Is their a way to set the DecimalPlaces property in code
when appending a field object?

Yes, but since that's one of the Access custom properties
(as opposed to the Jet builtin properties), you have to
create the property yourself.

Here's some code that does this for the Caption property:

Set dbCur = CurrentDb()
Set tdf = dbCur.TableDefs("ZZZ")
Set fld = tdf.CreateField("MyField", dbLong)
tdf.Fields.Append fld
Set prp = fld.CreateProperty("Caption",dbText,"abc")
fld.Properties.Append prp
fld.Properties.Refresh
tdf.Fields.Refresh
 
Back
Top