Hi people! I'm having some trouble when I try to update a combo box cascading. I'll simplify a bit mentioning only where the problems are.
I have a table with 3 fields: Product, Storage and quantity. The first two are the primary key. I made a form with two combo boxes, the first one is a simple combo box with this as data origin:
SELECT Product FROM Distribution GROUP BY Product ORDER BY Product;
Works fine. In the second one I want to show only the storages where the selected product is, so I create the next query:
SELECT Distribution.Storage
FROM Distribution
WHERE (((Distribution.Product)=[Forms]![Loans]![ProductList]));
I put this query as the data source of the second combo box and then I added in the afterupdate event of the first combo box:
Private Sub ProductList_AfterUpdate()
Me.StorageList.Requery ' StorageList is the dependant combo box
End Sub
The problem: it only works the first time. If I choose an option the combo box is updated, but if I change what I have selected it doesn't change, I must update the entire form manually. I'm not sure if it is a programing problem or something in my access database, because I downloaded some examples of cascading combo boxes that should be working and they don't work.
Any ideas? Oh, and thanks for your help!