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

add to listbox from 2 other listboxes

Status
Not open for further replies.

abenitez77

IS-IT--Management
Oct 18, 2007
147
US
I have 3 listboxes

I select 1 item from listbox1 and 1 item from listbox2

then I hit a button on my form and I want to copy those 2 items to my listbox3 (it has 2 columns) . They would be in 1 row (listbox1 in column0 and listbox2 in column1). Then I want to be able to remove a row from listbox3 or add more items from listbox1 and listbox2.

How can I do this ?
 
private sub Click_Button()

me.listbox3.rowsource=""

if not isnull(me.listbox1) then
me.listbox3.rowsource = me.listbox3.rowsource & me.listbox1 & ";"
end if

if not isnull(me.listbox2) then
me.listbox3.rowsource = me.listbox3.rowsource & me.listbox2 & ";"
end if

end sub
 
How are ya KiaruB . . .

Out of curiosity ... how did yu know the recordsource was a [blue]Value List![/blue].

Not only that ... but your code clears the list 1st ...
Code:
[blue]me.listbox3.rowsource=""[/blue]
... instead of appending!

I wish I had your hind sight! ...

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top