M
Mick
Hi
In a module I have the following code to add a Currency field to a table:
Public Function CreateAField()
Dim db As DATABASE, tdf As TableDef, fld As Field
Set db = DBEngine.OpenDatabase("d:\access 97\tables.mdb")
Set tdf = db.TableDefs("tblOrders")
Set fld = tdf.CreateField("Currency",dbCurrency)
tdf.Fields.Append fld
tdf.Fields.Refresh
End Function
This works fine as far as it goes. However, in addition to this I need to
set the DecimalPlaces to 2, set the required property and also a Default
value.
I am using Access 97 for this routine.
Thanks in advance for any suggestions.
Mick
In a module I have the following code to add a Currency field to a table:
Public Function CreateAField()
Dim db As DATABASE, tdf As TableDef, fld As Field
Set db = DBEngine.OpenDatabase("d:\access 97\tables.mdb")
Set tdf = db.TableDefs("tblOrders")
Set fld = tdf.CreateField("Currency",dbCurrency)
tdf.Fields.Append fld
tdf.Fields.Refresh
End Function
This works fine as far as it goes. However, in addition to this I need to
set the DecimalPlaces to 2, set the required property and also a Default
value.
I am using Access 97 for this routine.
Thanks in advance for any suggestions.
Mick