R
Richard Krupa
Hey Guys,
Im trying to add a date field to an existing table using VBA but its not
working. I have it working for boolean, currency, text etc.. just not date.
strDB = "C:\testdatabase.mdb"
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strDB)
Set tdf = dbs.TableDefs(TestTbl)
Set fld = tdf.CreateField(TestDate, dbDate)
fld.DefaultValue = Now()
tdf.Fields.Append fld
Set prp = fld.CreateProperty("Format", dbText, "General Date")
fld.Properties.Append prp
Set prp = fld.CreateProperty("Description", dbText, "testing date
add")
fld.Properties.Append prp
Set dbs = Nothing
Any help would be greatly appreciated!
Im trying to add a date field to an existing table using VBA but its not
working. I have it working for boolean, currency, text etc.. just not date.
strDB = "C:\testdatabase.mdb"
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strDB)
Set tdf = dbs.TableDefs(TestTbl)
Set fld = tdf.CreateField(TestDate, dbDate)
fld.DefaultValue = Now()
tdf.Fields.Append fld
Set prp = fld.CreateProperty("Format", dbText, "General Date")
fld.Properties.Append prp
Set prp = fld.CreateProperty("Description", dbText, "testing date
add")
fld.Properties.Append prp
Set dbs = Nothing
Any help would be greatly appreciated!