How to set the decimal places in MS Access 97 using VB

How to set the decimal places in MS Access 97 using VB

Post by Steve M » Thu, 10 May 2001 08:58:56



I used the VB code to add the single field to a table in Access.
The table already exsits. The name is  rpt_DayProd.  I just want to append a
new field to it.  In VB 6, I used the following code:
Dim pdb As Database
Dim tblDayProd As TableDef
Dim fld As Field

Set tblDayProd = pdb.CreateTableDef("rpt_DayProd")
Set fld = tblDayProd.CreateField("pat_return", dbSingle)
tblDayProd.Fields.Append fld
pdb.TableDefs.Append tblDayProd

It will add the field pat_return to the table.  I want to set this field
with 2 decimal places.  I do not know how.

Steve Ma