怎樣在access中用腳本語句給字段添加注釋?
Sub AppendDescriptionToField(ByVal TableName As String, ByVal FieldName As String, ByVal Description As String) On Error GoTo ErrP Dim TDS As TableDefs Dim TD As TableDef Dim F As dao.Field Dim P As Property Set TDS = CurrentDb.TableDefs Set TD = TDS(TableName) Set F = TD.Fields(FieldName) Set P = F.CreateProperty("Description", dbText, Description) F.Properties.Append PExitSub: Set P = Nothing Set F = Nothing Set TD = Nothing Set TDS = Nothing Exit SubErrP: If Err.Number = 3367 Then F.Properties("Description") = Description Else MsgBox Err.Number & " " & Err.Description End If GoTo ExitSubEnd Sub 復制上面的代碼到一個模塊中,在其他在方就可以調用了使用方法 AppendDescriptionToField "表名","字段名","該字段的說明文本"