Hi all,

I have an issue with a listbox not clearing properly when requeried.

1)
I have a combo box from which I can select different products; Product1, Product2, etc. (these are stored in ListProductT)

2)
In a list box I have various components that are used in the products. Some of these are common, but not all. (Stored in ListComponentT)
These combinations are listed in a table, eg:
ProductName ComponentName
Product1 A
Product1 B
Product1 C
Product2 A
Product2 X
Product2 Y

3)
When I select a product I wan the list box to be populated with the components for that product. This I have done with row source:
SELECT
[ListComponentT].[ComponentName],
[ListComponentT].[ProductName] FROM ListComponentT WHERE (((
[ListComponentT].[ProductName])=SelectedProduct)) ORDER BY
[ListComponentT].[ComponentName];


4)
Updating the list is simple - or so i thought. I do this by using AfterUpdate() code on the ComboBox: Me.ComponentBox.Requery

5)
The problem occurs when I want to clear the Component list box checkmarks first. I do this with;
Dim i As Integer
For i = Me.ComponentBox.ListCount - 1 To 0 Step -1
If Me.ComponentBox.Selected(i) = True Then
Me.ComponentBox.Selected(i) = False
End If
Next i

I can make both of these work if I put them in a command button, by first clearing the list and then requerying it.
But I naturally want this to occur when the user changes product. But when I put these into the AfterUpdate sub then it
-Clears the checkmarks in the listbox
-Requeries the listbox
-Checks the already cleared checkmarks

It is frustrating, since I can get it to work separately.

Please advise. And work-arounds are also valued