I can't set the field description property with the code below. I get
the error "Item cannot be found in the collection corresponding to the
requested name or ordinal". Any ideas. TIA...
Sub Test()
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Dim col As ADOX.Column
Set cat = New Catalog
cat.ActiveConne ction = CurrentProject. Connection
Set tbl = New ADOX.Table
With tbl
.Name = g_sTable
'code to get oFlds object not shown
For Each oFld In oFlds.Rows
Set col = New ADOX.Column
col.Name = oFld("FIELDNAME ")
'error occurs here
col.Properties( "Description"). Value = oFld("FIELDTEXT ")
.Columns.Append col
Next
End With
cat.Tables.Appe nd tbl
Set col = Nothing
Set tbl = Nothing
Set cat = Nothing
End Sub
the error "Item cannot be found in the collection corresponding to the
requested name or ordinal". Any ideas. TIA...
Sub Test()
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Dim col As ADOX.Column
Set cat = New Catalog
cat.ActiveConne ction = CurrentProject. Connection
Set tbl = New ADOX.Table
With tbl
.Name = g_sTable
'code to get oFlds object not shown
For Each oFld In oFlds.Rows
Set col = New ADOX.Column
col.Name = oFld("FIELDNAME ")
'error occurs here
col.Properties( "Description"). Value = oFld("FIELDTEXT ")
.Columns.Append col
Next
End With
cat.Tables.Appe nd tbl
Set col = Nothing
Set tbl = Nothing
Set cat = Nothing
End Sub
Comment