I found a response from rhicks back in Oct 2000 that solved 90% of my problem.
The first part of my dilemma was to populate a text box with what I have selected in a combo/list box.
This is what rhicks helped with:
Private Sub cmdSelectItems_Click()
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strTemp As String
Set frm = Me 'sets form to active form
Set ctl = frm!YourListBox 'Name of your listbox
For Each varItem In ctl.ItemsSelected
strTemp = strTemp & ctl.ItemData(varItem) & ", " 'adds the comma and space
Next varItem
strTemp = Left$(strTemp, Len(strTemp) - 2) 'Remove the last comma and space
Me![txtResultOfList] = strTemp
End Sub
This works fantastic for that application.
However,I want to add more selections to the existing selections already in the text box.
For example if the text box already has 1,4,7, as values I want to add 2,3,8 without wiping out 1,4,7 which is what happens.
I hope this makes sense.
Any help is good help.
And thank you rhicks , where ever you are...
The first part of my dilemma was to populate a text box with what I have selected in a combo/list box.
This is what rhicks helped with:
Private Sub cmdSelectItems_Click()
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strTemp As String
Set frm = Me 'sets form to active form
Set ctl = frm!YourListBox 'Name of your listbox
For Each varItem In ctl.ItemsSelected
strTemp = strTemp & ctl.ItemData(varItem) & ", " 'adds the comma and space
Next varItem
strTemp = Left$(strTemp, Len(strTemp) - 2) 'Remove the last comma and space
Me![txtResultOfList] = strTemp
End Sub
This works fantastic for that application.
However,I want to add more selections to the existing selections already in the text box.
For example if the text box already has 1,4,7, as values I want to add 2,3,8 without wiping out 1,4,7 which is what happens.
I hope this makes sense.
Any help is good help.
And thank you rhicks , where ever you are...