I have a list box with some items in it.
I have a command button that allows the user to save the items (once selected - can also multi select) like this:
And this also saves to the table
However if i click on the list again - everything disappears and the record from the table is also removed - like this:
Here is the code behind the cmdbutton
Can you please tell me what i've done wrong?
Thanks
I have a command button that allows the user to save the items (once selected - can also multi select) like this:
And this also saves to the table
However if i click on the list again - everything disappears and the record from the table is also removed - like this:
Here is the code behind the cmdbutton
Code:
Dim SelectedVals
Dim item
Dim ctlList As Control
'List box is called List56
For Each item In List56.ItemsSelected
If SelectedVals > "" Then
SelectedVals = SelectedVals & ", " & List56.ItemData(item)
Else
SelectedVals = List56.ItemData(item)
End If
Next item
'Text Box is called Text59
Me!Text59 = SelectedVals
Set ctlList = Me!List56
ctlList.Requery
Thanks