I want to display fields from an Oracle table in a dropdown combo box. I'm doing a SELECT * FROM the table name, and then populating the combo box as follows: (Where FieldsRs is my recordset object)
Dim i As Integer
Dim iFieldCount As Integer
iFieldCount = FieldsRs.Fields.Count
For i = 0 to iFieldCount - 1
cboStationRef.AddItem FieldsRs.Fields(i).Name
Next
This does a sterling job of populating my combo box with all the fields in the table, however, I don't want ALL the fields. There are 98 fields in the table names Attrib01 through Attrib99. There are 21 other field names in this table that I don't want in the combo box. I don't want to build an SQL statement that does a SELECT Attrib01, Attrib02, Attrib03, etc through Attrib99 because, in all likelihood, more attribute fields will be added, and I want my code to accommodate them without having to make any coding changes. Finding the index of each combo box item won't do any long-term good in so far as the index for each item will change as the fields in the table change. Any suggestions?
Dim i As Integer
Dim iFieldCount As Integer
iFieldCount = FieldsRs.Fields.Count
For i = 0 to iFieldCount - 1
cboStationRef.AddItem FieldsRs.Fields(i).Name
Next
This does a sterling job of populating my combo box with all the fields in the table, however, I don't want ALL the fields. There are 98 fields in the table names Attrib01 through Attrib99. There are 21 other field names in this table that I don't want in the combo box. I don't want to build an SQL statement that does a SELECT Attrib01, Attrib02, Attrib03, etc through Attrib99 because, in all likelihood, more attribute fields will be added, and I want my code to accommodate them without having to make any coding changes. Finding the index of each combo box item won't do any long-term good in so far as the index for each item will change as the fields in the table change. Any suggestions?