Reputation: 51
working on an internal tool and trying to find out how I could see the type of a column in a table while using MS Access. I need to know the types so that I can better handle the issue when I am comparing identical column captions but different types. Thanks!
Upvotes: 0
Views: 121
Reputation: 703
You can use the type property of the field you want to examine. Here is a link with all data types: http://msdn.microsoft.com/en-us/library/office/ff845405.aspx
And a code snippet to get you started.
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
Upvotes: 1