I have to create an new/add a field to a table in vba.
I need to set one field to be an boolaen type.
I get that to work but I also have to be able to set the format of the feild to be "yes/no".
I am able to set the defaultvalue prop but I can not get to the format prop.
THANK YOU
here is the code i am using to create the table.
I need to set one field to be an boolaen type.
I get that to work but I also have to be able to set the format of the feild to be "yes/no".
I am able to set the defaultvalue prop but I can not get to the format prop.
THANK YOU
here is the code i am using to create the table.
Code:
Sub CreateTable()
Dim db As DAO.Database
Dim tbl As DAO.TableDef
' Open the database
Set db = DBEngine.OpenDatabase("test1.mdb")
Set tbl = db.TableDefs("contacts")
With tbl
.Fields.Append .CreateField("test", dbBoolean)
.Fields(1).DefaultValue = "no"
End With
' Add the new table to the database.
'db.TableDefs.Append tbl
db.Close
End Sub