I want to be able to print out the column names and datatypes for my tables in access. Does anyone know a way to do this?
format your code!! - [vbcode] [/vbcode] ANSWERS CAN BE FOUND HERE!! my personal company
VB Code: Dim tbl As TableDef Dim x As Integer Set tbl = DBEngine(0)(0).TableDefs("TableName") For x = 0 To tbl.Fields.count - 1 Debug.Print tbl.Fields(x).Name Debug.Print tbl.Fields(x).Type Next type will return Numbers...you need to figure out what is what I know 10 is text 4 is Long and 1 is Boolean (Yes/No)
Dim tbl As TableDef Dim x As Integer Set tbl = DBEngine(0)(0).TableDefs("TableName") For x = 0 To tbl.Fields.count - 1 Debug.Print tbl.Fields(x).Name Debug.Print tbl.Fields(x).Type Next
JPnyc rocks!! (Just ask him!) If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Forum Rules