[AccessD] Field Type

David McAfee davidmcafee at gmail.com
Wed Nov 5 11:23:00 CST 2014


In Access (2003), How can I get the Field Type, for a given Table Def Field
Type integer?

I used the following code to populate a table with field names and types
for given tables:

    Set db = OpenDatabase(Path & mdbName)
    Set td = db.TableDefs(TableName)
'****************************************
    For Each fld In td.Fields
        strSQL = "INSERT INTO tblFieldsInISRRE (FieldName, FieldType,
FieldSize, JunctFKID) VALUES ('" & fld.Name & "', '" & fld.Type & "', " &
fld.Size & ", " & JunctPKID & ")"
        DoCmd.SetWarnings False
            DoCmd.RunSQL (strSQL)
        DoCmd.SetWarnings (True)
    Next

Now when I query the table, I get everything that I need except the field
type (Number, text...)

Instead I get 10,12,15,20,3,4,5,8 (and that is sorted ascending?!?!?)

Is there a sys table that I can join to, or make my own?

Thanks,
D


More information about the AccessD mailing list