All
I have a listbox where all of the values are selected by default on opening the form.
The user is able to (de)select values, but there must always be at least 1 value selected.
What is the target?
Suppose there is currently one item selected. If the user deselects it, that specific entry must be automatically reselected.
I tried to to this in a "before update"-event of the listbox, but this does not work. The item gets deselected and the "cancel=true" does not do the reselect.
I have a listbox where all of the values are selected by default on opening the form.
The user is able to (de)select values, but there must always be at least 1 value selected.
What is the target?
Suppose there is currently one item selected. If the user deselects it, that specific entry must be automatically reselected.
I tried to to this in a "before update"-event of the listbox, but this does not work. The item gets deselected and the "cancel=true" does not do the reselect.
Code:
Private Sub lstFilterDate_BeforeUpdate(Cancel As Integer)
If Me.lstFilterDate.ItemsSelected.Count = 0 Then
Cancel = True
End If
End Sub