I have two tables Suppliers with SupplierID as the primary key and another table Products with ProductID as the primary key and SupplierID as a foreign key linked to Suppliers.
I have a form with a combo box SupplierID and a subform with a ProductID combo box.
For the SupplierID combo box the rowsource is: SELECT DISTINCTROW Suppliers.* FROM Suppliers ORDER BY Suppliers.SupplierName
and it AfterUpdate event is:
Forms![Purchase Orders Subform].ProductID.Requery
For the ProductID combo box rowsource the WHERE clause is:
WHERE Products.SupplierID=Forms![Purchase Orders].SupplierID
I want the ProductsID combo to only show values based on the selection made in the SuppliersID Box.
I have followed the code examples for cascading combo boxes but I get the following error when I exit the SuppliersID combo box after selecting a value.
Microsoft Access cannot find the form 'Purchase Orders Subform' referred to in a Macro Expression or Visual Basic code.
What am I doing wrong?
I have a form with a combo box SupplierID and a subform with a ProductID combo box.
For the SupplierID combo box the rowsource is: SELECT DISTINCTROW Suppliers.* FROM Suppliers ORDER BY Suppliers.SupplierName
and it AfterUpdate event is:
Forms![Purchase Orders Subform].ProductID.Requery
For the ProductID combo box rowsource the WHERE clause is:
WHERE Products.SupplierID=Forms![Purchase Orders].SupplierID
I want the ProductsID combo to only show values based on the selection made in the SuppliersID Box.
I have followed the code examples for cascading combo boxes but I get the following error when I exit the SuppliersID combo box after selecting a value.
Microsoft Access cannot find the form 'Purchase Orders Subform' referred to in a Macro Expression or Visual Basic code.
What am I doing wrong?