![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Greetings, I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a dinosaur)... I'm traversing through the fields of a table to retrieve their data types, thus, Dim columntype as variant Set db = CurrentDb() Set tdf = db.TableDefs("MyTable") columncount = tdf.Fields.Count For i = 0 To columncount columntype = tdf.Fields(i).Type Next i What's happening is that "columntype = tdf.Fields(i).Type" is returning an integer, i.e, for a field of type "Text", it returns a "10", for a field of type "Number|Integer", it returns a "7", etc. Evidently these various data types have associated VB indexes. But I can't for the life of me find a page anywhere in Help or on the web that maps these VB integer values to their associated field data types. Help, anyone? I know, it's probably right under my nose somewhere... |
#3
| |||
| |||
|
|
Greetings, I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a dinosaur)... I'm traversing through the fields of a table to retrieve their data types, thus, Dim columntype as variant Set db = CurrentDb() Set tdf = db.TableDefs("MyTable") columncount = tdf.Fields.Count For i = 0 To columncount columntype = tdf.Fields(i).Type Next i What's happening is that "columntype = tdf.Fields(i).Type" is returning an integer, i.e, for a field of type "Text", it returns a "10", for a field of type "Number|Integer", it returns a "7", etc. Evidently these various data types have associated VB indexes. But I can't for the life of me find a page anywhere in Help or on the web that maps these VB integer values to their associated field data types. Help, anyone? I know, it's probably right under my nose somewhere... |
#4
| |||
| |||
|
|
Greetings, I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a dinosaur)... I'm traversing through the fields of a table to retrieve their data types, thus, Dim columntype as variant Set db = CurrentDb() Set tdf = db.TableDefs("MyTable") columncount = tdf.Fields.Count For i = 0 To columncount columntype = tdf.Fields(i).Type Next i What's happening is that "columntype = tdf.Fields(i).Type" is returning an integer, i.e, for a field of type "Text", it returns a "10", for a field of type "Number|Integer", it returns a "7", etc. Evidently these various data types have associated VB indexes. But I can't for the life of me find a page anywhere in Help or on the web that maps these VB integer values to their associated field data types. Help, anyone? I know, it's probably right under my nose somewhere... |
#5
| |||
| |||
|
|
Tom and Stuart have explained how to get these values for yourself. Here's a bit of code you can use to return the file type names: http://allenbrowne.com/func-06.html Cool. Many thanks for all the responses. |
![]() |
| Thread Tools | |
| Display Modes | |
| |