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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top