OK, maybe I'm not as dumb as I thought. Turns out the answer was already out there and with a little tweaking I got it to work.
For anyone else struggling:
1) make sure your listbox has multi select set to simple (on the "other" tab in the control properties).
2) on the events tab in the On Click property add the following code:
-
Private Sub ListBoxName_Click()
-
-
Dim SelectedValues As String
-
Dim frm As Form
-
Dim varItem As Variant
-
Dim lstItems As Control
-
Set lstItems = Me!ListBoxName
-
-
For Each varItem In lstItems.ItemsSelected
-
If SelectedValues > "" Then
-
SelectedValues = SelectedValues & ", " & lstItems.ItemData(varItem)
-
Else
-
SelectedValues = lstItems.ItemData(varItem)
-
End If
-
Next varItem
-
Me!FieldInTableToPopulate = SelectedValues
-
-
End Sub
-
Make sure you change the items in bold above to match your project.
*edit* bold doesn't seem to work in the code container so be sure to change:
ListBoxName and FieldInTableToPopulate