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

Listbox with Multiple columns 1

Status
Not open for further replies.

elohelae

Technical User
Feb 25, 2011
27
GB
Hello

I have two listboxes Listbox1 and listbox2. I used the code below to insert an item from listbox 1 to listbox 2.

Listbox 1 has 2 columns and i want to copy both columns to listbox 2. How do i modify the code below to copy both columns?

I appreciate any assistance.

Private Sub Command30_Click()

If Me.ListBox1.ListIndex >= 0 Then
Me.ListBox2.AddItem Me.ListBox1.ItemData(Me.ListBox1.ListIndex)


End If


End Sub

Allan
 
Try

Code:
If Me.ListBox1.ListIndex >= 0 Then
[indent]Me.ListBox2.AddItem Me.ListBox1.Column(0) & ";" & Me.ListBox1.Column(1)[/indent]
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top