Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formating data in combo box into two coloumns

Status
Not open for further replies.

pitamber

Programmer
Apr 10, 2003
15
US
I want my data in combo box into coloumn in proper coloumn wise
for eg combo1.additem rs(name) & rs(age)
can any one help me
thanks in advance

I tried with this but not working
Combo1.AddItem Format$("Chicago ", "!" & String(5, "@")) & "|ILbnv"


actually i am using UB grid
in that i am having combo box
 
Try

dim sItem as string
sitem = right(string(10," ")+cstr(rs("name")),10)+"|"+right(string(10," ")+cstr(rs("age")),10)
cboWhatever.additem sitem

Note I have assumed rs is an ado recordset.

A better solution though would perhaps to be to use the DataCombo that ships with VB. Long time since I played with it though!

mmilan.
 
I have been using some off the shelf widgets for this stuff.
There is a company that makes them called infragistics and they are only about $300. They are great and pretty easy to use. Way more funtionality then the canned microsoft ones. I found that I was rigging them or carring extra bagage by keepiing arrays open to carry the extra data. These have this build in.

There grids are very nice too.



Hope this helps
Alley
 
i am using ubgrid inside that one of my coloum is combo box
I tried u r code but allignment is get disturbed

For i = 0 To UBound(array, 2)
ubgrid.AddLookup 13,
CStr(array(1, i))
+ "-" +
CStr(array(2, i)),
Next i

this is the syntex of ubgrid to make coloum combo
ubgrid colno,item1 & item2

this item1 and item2 should form two coloum


thnx

 
pitamber, are you still using the MSForms 2.0 combo box? If so look into the Column and Column... properties. You should be able to set the number of columns and place data into the specific columns.

Sorry I can't help you with exact syntax.


zemp
 
zemp,I am using ubgrid where i can set any coloum as combo
syntex is mentioned in my above Question.
Any way i am trying u r suggestion of placing forms2.0 combo
on picture box and placing on flex grid
but my proj is almost completed using ubgrid
I stuck in this proj only for two coloum with proper formatting


thnx zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top