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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox with 2 Column

Status
Not open for further replies.

WaZda

Programmer
Jun 22, 2007
48
GB
hi every body,
can someone help me populate on a listbox, 2 columns of 2 differents fields of a table? I hope the question is clear enough. I want to have 2 column on my listbox. And the first column will have informations of field_1 of the table, and the second column will have informations of field_2 of the table.
Someone pls help.
 

Unlike VBA, VB 6 does not have 'out of the box' listbox with columns. Sorry.

What you can do is:
Code:
For i = 1 To Rec.RecordCount
    ListBox.AddItem rec!field_1 & " - " & Rec.field_2
    rec.MoveNext
Next i

Have fun.

---- Andy
 
> " - "

You may be better off replacing that with vbTab (and then messing about with the LB_SETTABSTOPS message if necessary)
 
thanks a lot everybody for your various tips.

Code:
 Andrzejek (Programmer)  	

Unlike VBA, VB 6 does not have 'out of the box' listbox with columns.  Sorry.

I think this answers my question.
I understand it's simply no possible. Ok got it.
 
or checkout the ListView Control as HughLerwill said.
The ListView will do exactly what you want.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top