polulate multiselct textbox with listbox column values

detrie

Registered User.
Local time
Today, 14:44
Joined
Feb 9, 2006
Messages
113
My form has a multiselect listbox with 5 columns
The form also has an unbound textbox

I need place all of the selected rows (column 1 thru 5) into the test box with a VbCrLf after each row

I can use a jumping off point

Thanks
Detrie
 
Me.TextboxName = Me.ListboxName.Column(0) & vbCrLf & Me.ListboxName.Column(1)...
 
Hi Paul.. Thanks for your reply
I should have been more clear...
I need place all of the selected rows (columns 1 thru 5) into the test box with a VbCrLf after each row

When the listbox has 4 rows selected, the textbox shuld look like this:

Column1 Column2 Column3 Column4 Column5
Column1 Column2 Column3 Column4 Column5
Column1 Column2 Column3 Column4 Column5
Column1 Column2 Column3 Column4 Column5

I'm trying to work this thru....

Dim varItem As Variant _
, mText As Variant _
, i As Integer

mText = Null

For Each varItem In Me.lstDeliverables.ItemsSelected
mText = mText + vbCrLf
For i = 0 To 4
mText = mText & Me.lstDeliverables.ItemData(varItem).Column(i) '& " "
Next i
Next varItem

Me.Text271 = mText

but
Access complains with Run-Time error '424' object required at
mText = mText & Me.lstDeliverables.ItemData(varItem).Column(i) & " "
 
Try

Me.lstDeliverables.Column(i, varItem)
 
TAH DAH!!!!!!
Thank you Paul.. That did.
 
No problem; you were clear enough, I just didn't notice the "selected items" bit. My eyes are faster than my brain. :eek:
 

Users who are viewing this thread

Back
Top Bottom