Hank.School
Registered User.
- Local time
- Today, 04:19
- Joined
- Oct 14, 2016
- Messages
- 39
[Solved] Queries with a table of related records
Hi guys,
Having a problem here and I can't seem to figure it out.
I have a query that provides records for a form. That query has its primary table which holds associations between records in another table. The query has duplicate 'cascades' necessary to retrieve my data but something is going wrong at the first related table.
To make it easier to understand, lets say my primary table, Meetings, holds a meeting between two customers. The primary table would contain two fields (among others), Customer1 and Customer2 which each hold an ID to two different customers in the same customers table. The cascade would be for each customer's associated information which is all held in other tables, each referenced by previous IDs. Yeah, I know... that's not too easy to understand either I will try to explain the cascade part further if required but I am hoping you understand.
The way I have handled this previously in a query was to duplicate each of the 'sub-tables' and relate one cascade of relationships to Customer1 and the other cascade to Customer2 and it has always worked. Now I am building a new form which should do the same thing but the same customer is being pulled up by both cascades.
In my test form, I have made fields which show the two customer IDs from the query's primary table and they are indeed different. But when I change the fields to display the data from the next related table (let's say customer name) both fields have the same name. Does anyone know why this would happen? The only difference for this query (as opposed to others I have done like this previously) is that this has 18 different tables... my others have been much smaller.
Anyone have any ideas?
Just to clarify, the customers is only an example... I would not structure a list of customers in a way requiring a cascade of relationships like this. The actual data is circuits which are a connection between two facilities but I think this is easier than trying to explain the whole database.
In the mean time, I am going to try and cut out some of the lower tables and see what happens.
Thanks
Hank
Hi guys,
Having a problem here and I can't seem to figure it out.
I have a query that provides records for a form. That query has its primary table which holds associations between records in another table. The query has duplicate 'cascades' necessary to retrieve my data but something is going wrong at the first related table.
To make it easier to understand, lets say my primary table, Meetings, holds a meeting between two customers. The primary table would contain two fields (among others), Customer1 and Customer2 which each hold an ID to two different customers in the same customers table. The cascade would be for each customer's associated information which is all held in other tables, each referenced by previous IDs. Yeah, I know... that's not too easy to understand either I will try to explain the cascade part further if required but I am hoping you understand.
The way I have handled this previously in a query was to duplicate each of the 'sub-tables' and relate one cascade of relationships to Customer1 and the other cascade to Customer2 and it has always worked. Now I am building a new form which should do the same thing but the same customer is being pulled up by both cascades.
In my test form, I have made fields which show the two customer IDs from the query's primary table and they are indeed different. But when I change the fields to display the data from the next related table (let's say customer name) both fields have the same name. Does anyone know why this would happen? The only difference for this query (as opposed to others I have done like this previously) is that this has 18 different tables... my others have been much smaller.
Anyone have any ideas?
Just to clarify, the customers is only an example... I would not structure a list of customers in a way requiring a cascade of relationships like this. The actual data is circuits which are a connection between two facilities but I think this is easier than trying to explain the whole database.
In the mean time, I am going to try and cut out some of the lower tables and see what happens.
Thanks
Hank
Last edited: