# DBcombo in vb6



## fabulous (May 25, 2004)

hi ppl 
now i have a dbcombo and i want it to show me two fields intead of one and i don't know how to do that.
i mean 2 columns from the same table
can someone please help me?


----------



## OBP (Mar 8, 2005)

fabulous, I do not know VB6, but I know Access/Excel VBA. Can you post the code for a single column combo and I will see if I cananswer your question.


----------



## coderitr (Oct 12, 2003)

Combine the fields into one result column in the datasource property. As in:


```
select city & ", " & state as location from address
```
That should work for access but you'll need to find out how to concatenate columns in your specific database if you're using something else.


----------



## RGregory (Jul 27, 2005)

Another way to do it is to set the combobox's columncount property to the number of columns you want. I don't have a copy of VB6 available, but looking at VBA in Access it is allowed <G>. Here is the code in my program...

cboTitle.ColumnCount = 4
cboTitle.ColumnWidths = "3.875 in;0;0;0"

I only need to view the first column, so I set the widths for the other columns to 0.


----------

