0
我一直在努力,使這個代碼在獲得工作,只是一個新的領域列添加到一個名爲「收藏」表,但似乎訪問不做任何事情:添加字段來記錄
Sub CreateCalculatedField()
Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field2
' get the database
Set dbs = CurrentDb()
' create the table
Set tdf = dbs.CreateTableDef("Collections")
' create the fields: first name, last name
tdf.Fields.Append tdf.CreateField("Running Total", dbText, 20)
Cleanup:
Set fld = Nothing
Set tdf = Nothing
Set dbs = Nothing
End Sub
有我錯過了什麼?
https://social.msdn.microsoft.com/Forums/en-US/7c5a749d-a479-4486-abf8-e1c9d49ef057/adding-a-table-column-using -vba式訪問?論壇= isvvba –