ShowFields の引数に確認したいテーブル名を指定します。結果はイミディエイト ウィンドウに表示します。
Sub ShowFields(TableName As String) Dim Database As DAO.Database Dim Field As DAO.Field Set Database = CurrentDb For Each Field In Database.TableDefs(TableName).Fields Debug.Print Field.Name & vbTab & GetTypeName(Field.Type) Next End Sub Function GetTypeName(Value As DataTypeEnum) As String Select Case Value Case DataTypeEnum.dbBigInt GetTypeName = "多倍長整数型 (Big Integer)" Case DataTypeEnum.dbBinary GetTypeName = "バイナリ型 (Binary)" Case DataTypeEnum.dbBoolean GetTypeName = "ブール型 (Boolean)" Case DataTypeEnum.dbByte GetTypeName = "バイト型 (Byte)" Case DataTypeEnum.dbChar GetTypeName = "文字型 (Char)" Case DataTypeEnum.dbCurrency GetTypeName = "通貨型 (Currency)" Case DataTypeEnum.dbDate GetTypeName = "日付/時刻型 (Date/Time)" Case DataTypeEnum.dbDecimal GetTypeName = "10 進型 (Decimal)" Case DataTypeEnum.dbDouble GetTypeName = "倍精度浮動小数点型 (Double)" Case DataTypeEnum.dbFloat GetTypeName = "浮動小数点型 (Float)" Case DataTypeEnum.dbGUID GetTypeName = "GUID 型 (GUID)" Case DataTypeEnum.dbInteger GetTypeName = "整数型 (Integer)" Case DataTypeEnum.dbLong GetTypeName = "長整数型 (Long)" Case DataTypeEnum.dbLongBinary GetTypeName = "ロング バイナリ型 (Long Binary)" Case DataTypeEnum.dbMemo GetTypeName = "メモ型 (Memo)" Case DataTypeEnum.dbNumeric GetTypeName = "数値型 (Numeric)" Case DataTypeEnum.dbSingle GetTypeName = "単精度浮動小数点型 (Single)" Case DataTypeEnum.dbText GetTypeName = "テキスト型 (Text)" Case DataTypeEnum.dbTime GetTypeName = "時刻型 (Time)" Case DataTypeEnum.dbTimeStamp GetTypeName = "タイムスタンプ型 (TimeStamp)" Case DataTypeEnum.dbVarBinary GetTypeName = "可変長バイナリ型 (VarBinary)" Case Else GetTypeName = "undefined" End Select End Function
■ 参考資料
Field.Type プロパティ (DAO)https://msdn.microsoft.com/ja-jp/library/office/ff845405.aspx
DataTypeEnum 列挙 (DAO)
https://msdn.microsoft.com/JA-JP/library/office/ff194420.aspx