How to create a decimal field in MsAccess using DAO?
Question
I need to create a decimal field in MsAccess 2003 through DAO. How do I do that? Other fields I can create using following codesnippet, but not decimal.
How do I set type, precision and scale?
NOTE : a decimals datatype = 20, but setting a datatype to 20 results in invalid data type
Dim db As DAO.Database
Dim tbl As TableDef
Dim fld As Field
Set db = CurrentDb
tbl = database.CreateTableDef("Test")
fld = tbl.CreateField( .... )
Solution
You may find this useful: http://allenbrowne.com/ser-49.html#_ftn7
It states that decimal is not available in DAO and ADO should be used to create such fields.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow