Ask Your Question

Revision history [back]

The problem is that the constraint you want to place on the List Box contents is contained in the customer_id in the MainForm. This will obviously change depending on the selected record on the MainForm.

As I see it this value can only be obtained using a Macro. As a test run the macro from a form button. The macro would first store the value of the customer_id of the selected record in a variable. The List Box would be based on a Query of the addresses Table, like the Query you quoted but the WHERE clause being set to

WHERE "customer_id" = 0

The 0 is just a temporary marker. The Macro would then modify the Query to change the value in the WHERE clause to the value in the variable and then refresh the Form. The List Box contents would then show only the addresses for the selected Customer.