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!

Selecting multiple records in a listbox and sending them to a form no

Status
Not open for further replies.

accessible

Technical User
Aug 12, 2001
3
AE
I reviewed most of the FAQ and the forums about Access and could not find a clear answer to my problem. I have a listbox but it could be a datasheet with several records. I want to select some of these records and send them to a Text box or any other object database and this object is not linked to that listbox.And this Textbox/object should accept more than one record or at least a second record added should not erase the previous ones.
Thanks for your input,

Accessible
 
This code goes through a listbox and places all items selected in the listbox separated by commas:

[tt]
Dim ItemSelected
Dim Result As String

For Each ItemSelected In MyListBoxName.ItemsSelected
Result = Result & MyListBoxName.ItemData(ItemSelected) & ","
Next ItemSelected

MyTextBoxName= Left(Result, Len(Result) - 1)
[/tt]

HTH
Joe Miller
joe.miller@flotech.net
 
Thanks a lot.That was a quick answer. I'll come back to you .

Accessible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top