I have the following code in the AdfterUpdate event of a simple multi select listbox. The code puts the selected items in order (separated by commas) and works fine. However when I scroll through other records, the listbox doesn't update to show the current selection in the new record. Here is the code;
Private Sub List201_AfterUpdate()
Dim varItem As Variant
Dim txtTemp As String
For Each varItem In Me.List201.ItemsSelected
txtTemp = txtTemp & Me.List201.ItemData(varItem) & ","
Next
If Len(txtTemp) > 0 Then
txtTemp = Left(txtTemp, Len(txtTemp) - 1)
End If
Me.HowMany.Value = txtTemp
End Sub
Any pointers would be great!!
Private Sub List201_AfterUpdate()
Dim varItem As Variant
Dim txtTemp As String
For Each varItem In Me.List201.ItemsSelected
txtTemp = txtTemp & Me.List201.ItemData(varItem) & ","
Next
If Len(txtTemp) > 0 Then
txtTemp = Left(txtTemp, Len(txtTemp) - 1)
End If
Me.HowMany.Value = txtTemp
End Sub
Any pointers would be great!!