|
怎样在VBA中用代码创建带CAPTION和DESCRIPTION的表。
下面是我的代码:
Private Sub CreateTRDTableDef()
Dim tdfTable As DAO.TableDef
Dim fldField As DAO.Field
Dim intCount As Integer
Dim strTableName As String
DoCmd.Echo True, "Creating table definition......"
strTableName = "TEST"
DoCmd.Echo True, "Creating " & strTableName & " table definition....."
Set tdfTable = CurrentDb.CreateTableDef(strTableName)
Set fldField = tdfTable.CreateField("FIRST_NAME", dbText, 20)
'下面两句出错:请高手指点,如何设定在表中字段的Caption和Description的属性值
'fldField.Caption = "First Name"
'fldField.Description = "lease input first name"
tdfTable.Fields.Append fldField
CurrentDb.TableDefs.Append tdfTable
Set tdfTable = Nothing
Set fldField = Nothing
DoCmd.Echo True, "Ready"
End Sub
|
|