MangoFruit
Registered User.
- Local time
- Today, 08:38
- Joined
- Feb 6, 2014
- Messages
- 19
Hi all,
I'll try to explain this as clearly as possible:
I have a database consisting of 4 tables, each containing items of a certain type. I also have a 5th table which is a join table, because different combinations of items have specific properties (e.g. 1 item is 50 cm long, the other is 60 cm long, yet together they are nog 110 cm long but only 90 cm long). We use the join table to store the combined dimensions and weight. Then I made a qry that simply displays all fields from all 5 tables.
Now we have a form based on that query with 4 combo boxes to choose 1 item from each table and then we want it to give both the dimensions and weight of each individual item, and the combined dimensions and weight of all 4 together. I made the combo boxes cascading by putting the following in the row source of the 2nd combo box:
SELECT [qry Database].[ItemCategory2 Code] FROM [qry Database] WHERE ((([qry Database].[ItemCategory1 Code])=[forms]![frm MainForm]![cbo ItemCategory1 Code])) GROUP BY [qry Database].[ItemCategory2 Code];
And for each following combo box I added an extra 'where' clause. This actually seems to work, whenever I select an item in combo box 1, the choice for the second combo box is correctly narrowed down, then the same goes for combo box 3 and 4.
Now comes the problem: I want to display the dimensions and weight for each of the 4 chosen items (so not the combined dimensions and weight). However this is not working. When I choose the first item I get the correct info for that item. When I choose the second it displays the correct dimensions for that one but not always for the first one. I think it chooses the first record that contains the 2nd item rather than choosing the first record of all the records that contain a combination of item 1 and 2. I don't understand why the cascading combo boxes seem to work just fine, but I can't get my form to show the correct details belonging to my selection?
Any help would be much appreciated.
I'll try to explain this as clearly as possible:
I have a database consisting of 4 tables, each containing items of a certain type. I also have a 5th table which is a join table, because different combinations of items have specific properties (e.g. 1 item is 50 cm long, the other is 60 cm long, yet together they are nog 110 cm long but only 90 cm long). We use the join table to store the combined dimensions and weight. Then I made a qry that simply displays all fields from all 5 tables.
Now we have a form based on that query with 4 combo boxes to choose 1 item from each table and then we want it to give both the dimensions and weight of each individual item, and the combined dimensions and weight of all 4 together. I made the combo boxes cascading by putting the following in the row source of the 2nd combo box:
SELECT [qry Database].[ItemCategory2 Code] FROM [qry Database] WHERE ((([qry Database].[ItemCategory1 Code])=[forms]![frm MainForm]![cbo ItemCategory1 Code])) GROUP BY [qry Database].[ItemCategory2 Code];
And for each following combo box I added an extra 'where' clause. This actually seems to work, whenever I select an item in combo box 1, the choice for the second combo box is correctly narrowed down, then the same goes for combo box 3 and 4.
Now comes the problem: I want to display the dimensions and weight for each of the 4 chosen items (so not the combined dimensions and weight). However this is not working. When I choose the first item I get the correct info for that item. When I choose the second it displays the correct dimensions for that one but not always for the first one. I think it chooses the first record that contains the 2nd item rather than choosing the first record of all the records that contain a combination of item 1 and 2. I don't understand why the cascading combo boxes seem to work just fine, but I can't get my form to show the correct details belonging to my selection?
Any help would be much appreciated.