I have code that creates a temp table, but I need the single column to go to two decimals. I inherited this and that is what the original programmer had in the temp table, but this thing have over 100 tables and I am trying to create and destroy temp tables as they are needed rather than clutter up the object window. The statement to create the table, create the compound key and then set the property is:
dbs.Execute "CREATE TABLE " & strTableOne & " (FNSType CHAR, QNeed CHAR, QAverage Single)"
Call CreateCompountKey(strTableOne, "FNSType", "QNeed") 'Creates primary key
Call CreateProperty(strTableOne, "QNeed")
The below is not doing what I think it should be and not sure why as all the samples I have Googled point to this
as being correct.
Public Sub CreateProperty(strTableName As String, strFieldName As String)
Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Set dbs = CurrentDb
Set tdf = dbs.TableDefs(strTableName)
Set fld = tdf.Fields(strFieldName)
Set prp = .CreateProperty("DECIMALPLACES", dbSingle, 2)