|
-
Feb 15th, 2001, 01:19 PM
#1
Thread Starter
Addicted Member
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
-
Feb 15th, 2001, 01:21 PM
#2
The pipe, or any other character or spaces, is the only thing you can do for the combo. It is no made for that.
-
Feb 15th, 2001, 01:24 PM
#3
Thread Starter
Addicted Member
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.
-
Feb 15th, 2001, 01:28 PM
#4
The whats wrong with the example you have? Just replace the "|" with a "-"
-
Feb 15th, 2001, 01:31 PM
#5
Thread Starter
Addicted Member
it has a ugly format and I have to Accommodate for spacing
-
Feb 15th, 2001, 01:36 PM
#6
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!
-
Feb 15th, 2001, 01:36 PM
#7
Fanatic Member
You could always use a fixed width font and get the effect of having columns.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 15th, 2001, 01:47 PM
#8
Member
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 " " .
-
Feb 15th, 2001, 01:58 PM
#9
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|