VB 6.0 - How to create multiple columns in a como box?

Asked By Ralph Acido on 27-Sep-05 08:58 PM
Im creating a simple application.  My problem is how can i display 2 fields in a combo box.  Like for example i want to display (00001    Heizel Mamuad)...  00001 is the ID Number  and Heizel Mamuad is the Name of the student(fileds in a table)..  any help? 

Thank you...

hi - Asked By Venkat K on 27-Sep-05 10:56 PM

take all the values from the database into some array

then concatnate the both fields which you want to display, here id and name


combo1.additem arr(0) & "-" &  arr(2)

where arr(0) is the id, and arr(2) is the name

Multiple Columns in combo box - Asked By Sunitha Nambari on 28-Sep-05 12:58 AM


We can add 2 fields and display in a combo box:
Ex: ID+" "+CustName 
When you are doing this through query,it will be customary to mention ID+" "+CustName
 If you want to display two column fields in the DropDownList with some separator, then this one comes in the picture. Example: let’s say database columns are ID and CustName, but you want to display ID#CusttName in the DropDownList, then you will put “#” in the DisplayColumnSeparator property.

Here is a link which tells abt combo box:


You Can - Asked By Sameer Jain on 28-Sep-05 02:59 AM

U can add two columns In to a combo box

you need to run a loop till the recordset ends

cmbBox.addItem (zRs("IDNumber") & "," & Rs("Name"))

You can place the "," as the seperator which will help you to check or perform some insert/search very easily as you can split the checked item with the , seperator.
otherwise you can just place a " " insted of the ","

Thank you guys - Asked By Ralph Acido on 28-Sep-05 08:04 PM
Thank you very much guys.. Your idea helps me a lot my application..Again Thank you...