How to empty combo box contents
Posted on 2004-09-20
I have the followng After update event
Private Sub CategoryID_AfterUpdate()
If Me.ProductID.ListCount <> 0 Then
ProductID = ProductID.ItemData(0)
The purpose is to only show Products in the Product Combo box which are associated with the chosen category. It works fine as long as there are products in a chosen category, however if the category happens to be empty, what displays in the Product combo box is whatever was last listed there. In other words, if I choose a category, choose product A, then change the category to a category that has no products, product A is still listed in the combo box.
What change do I have to make to make the Product combo box go back to empty if the catebory is empty?