Hello,
I am new to design and program FORMs in ACCESS. what i was trying to do is build a multi select list box on the form and then assign user selected item to a field on the form. i found a code snippet online and modified a bit. i can use Messagebox to display selected items, but the value did not saved into my table.
List133 is the listbox name. i am trying to assgin strValue to a field called "Language" in my table. if it is not a multi selected listbox, the selected item will be saved in to the Language field, but how to make it work for multi-select listbox?
Thank you for your time and hope my question makes sense to you.
Private Sub List133_Exit(Cancel As Integer)
Dim valSelect As Variant
Dim strValue As String ' just used for the demonstration
For Each valSelect In Me.List133.ItemsSelected
strValue = strValue & "'" & Me.List133.ItemData(valSelect) & "', "
Next valSelect
' to remove trailing comma
strValue = Left(strValue, Len(strValue) - 2)
MsgBox strValue
End Sub