After a list box chosen, Use a cmd button, the list box not select

H

harry.martin

I have a situation where I am giving the user the option of using a List Box
or a Command Button. The list box is one choice, and the Command Button is
All. If the user first selects the list box, then the choice remains in
black. However, if the user then chooses the Command Button I want the
selection cleared out of the list box as though it was never selected. I
want to be able to do this without closing the form and reopening it. I am
using Access 2000.
 
H

harry.martin

To All: I found the answer in an earlier post. Thank you. The answer is
under Deselect a List Box - Date of Post 7-25-06.
 
K

Klatuu

There is an easier way. If no selection is made, the .ListCount property of
the list box will retun 0. I would suggest you make this decision in the
Click event of the command button:

If Me.MyListBox.ListCount = 0 Then
'Do what you want for all
Else
'Process the selections
End If
 
Top