2013-07-19 36 views

回答

1

您可以使用您要檢查的字段的type屬性。這裏是所有數據類型的鏈接: http://msdn.microsoft.com/en-us/library/office/ff845405.aspx

和一個代碼片段,讓你開始。

Option Compare Database 
Option Explicit 

Sub GetTypes() 
    Dim d As Database 
    Set d = CurrentDb 

    Dim t As TableDef 
    Set t = d.TableDefs("Table1") 

    Dim f As Field 
    For Each f In t.Fields 
     Debug.Print f.Name & " " & f.Type 
    Next f 
    Set f = Nothing 

    Set t = Nothing 
    Set d = Nothing 
End Sub 
相關問題