- Oct 11, 2000
- 56,336
- 11
- 0
I'm trying to query a table and its not working exactly the way I want it to.
Here is the generic setup.
Table 1 contains:
ID
Field1
Field2
The relationship between Field1 and Field2 is n-to-n, ie something can appear in Field1 more than once or Field2 more than once, but you won't ever have duplicate copies Field1 and Field2.
Table 2 contains:
Field3
Field4
Field3 is a listbox, source is a group by query on Field1.
Based on what was chosen as Field3, it will build its source based on a query on Field2 where Field3 = Field1.
All good right, but MS Access is fudgin' it up by not doing a query with the current Field3, but on all the values for Field3. I don't want this. :|
SELECT [Table1].[Field2] FROM [Table1] WHERE ([Table1].[Field1]=[Table2].[Field3]) ORDER BY [Table1].[Field2];
Your thoughts?
Here is the generic setup.
Table 1 contains:
ID
Field1
Field2
The relationship between Field1 and Field2 is n-to-n, ie something can appear in Field1 more than once or Field2 more than once, but you won't ever have duplicate copies Field1 and Field2.
Table 2 contains:
Field3
Field4
Field3 is a listbox, source is a group by query on Field1.
Based on what was chosen as Field3, it will build its source based on a query on Field2 where Field3 = Field1.
All good right, but MS Access is fudgin' it up by not doing a query with the current Field3, but on all the values for Field3. I don't want this. :|
SELECT [Table1].[Field2] FROM [Table1] WHERE ([Table1].[Field1]=[Table2].[Field3]) ORDER BY [Table1].[Field2];
Your thoughts?