Clearing List Box Choices

A

AccessIM

I have list boxes on a form for users to choose criteria for a second form.

I have the following code in the On Click events of buttons for each list box:

Dim varItem
For Each varItem In DamageReason.ItemsSelected
Me.DamageReason.Selected(varItem) = False
Next varItem

This works on the selection form in that it clears the selected item from
the list box. However, it still holds the selected items as criteria for the
form.

For example, the first box is to select a damage reason and the second box
is to select a spoilage reason. The first time, the user chooses "broken"
from the damage reason list to populate the second form. Then, they close
the second form and clear the damage reason box and choose "chargeback" from
the spoilage reason list to populate the second form again but with different
criteria.

The first item clears the selection from the list box but when you run the
form the second time it brings up all the "broken" reasons along with all the
"chargeback" reasons. The only thing that completely clears the criteria
selection is to close the form and reopen.

How can I get the criteria to clear without having to close the form? Thank
you in advance!
 

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

Top