-
Howdy!
I want to put more than one field from a DB in a combo box. I am using the standard combo box control. How do you do it
This example puts the 'pipe sign between, but I want to see seperate fields.
example:
cmb1.clear
Do While Not Adodc1.Recordset.EOF
vntTemp = Trim(Adodc1.Recordset.Fields(0))
vntTemp2 = Trim(Adodc1.Recordset.Fields(1))
cmb1.AddItem (vntTemp & "|" & vntTemp2)
vntTemp = ""
vntTemp2 = ""
Adodc1.Recordset.MoveNext
Loop
Thanx
-
The pipe, or any other character or spaces, is the only thing you can do for the combo. It is no made for that.
-
What is made for it?
What I need is a combobox that displays only one of the fields example 'Index' and when you click on the drop down, you will see the index field plus an additional field - Name
1 - bob
2 - mary
etc.
-
The whats wrong with the example you have? Just replace the "|" with a "-"
-
it has a ugly format and I have to Accommodate for spacing
-
Well unfortunatly thats about the best you can do..But that gives me an idea. when im finished writting the component i am writting now, maybe Ill try to tackle making a drop down listview..hmmm. Would be interesting!
-
You could always use a fixed width font and get the effect of having columns.
-
Her try this out !
For intCounter = 1 To intRecCount
Combo1.AddItem "" & rs!CUSTOMER & " " & " " & ""
& " " & rs!CUST_CD
rs.MoveNext
Next intCounter
The more spacing u want between the two fields add another " " .
-