These keep throwing curve balls at me.
I have a form in which I want to display the intermediaries (secretaries, PA's, receptionists etcetera) of our contacts.
Because some of these secretaries are important enough to us to count as contacts themselves, they are stored in our database as contacts in their own right.
And because it's possible that one person might act as an intermediary for many contacts, and one contact might have a few intermediaries, the relationship here is many to many.
So ... the relationship has to be stored with a junction table, and displayed on forms with a subform.
Rather than link the contact table straight back to itself through the junction table, I opted to create an extra link in the loop - building a table just for intermediaries, which uses the contact table ID field as a foreign key.
I've been building the subform with fields from the junction table. That worked fine.
I tried to proceed from there by making the subform's intermediaryID field a combo box - that pulled up the names of the people in the intermediary table rather than their ID numbers. This used the contact table[where the names are stored] and the intermediary table[which selects out the intermediaries] in the row source.
This hasn't worked. After I select an intermediary, when I click on something else I'm told that I "cannot add or change a record because a related one is required in the intermediaries table". The names I've selected belong to people who DO have records in the intermediaries table. My assumption is that the problem is that the link to the name is too indirect, since it isn't in the intermediaries table, but in the related contacts table. [The problem is the same if I take intermediaries out of the row source. - which has caused me troubles in the past]
I am avoiding the solution of putting the combo box in the intermediary table, and then pulling this up directly from the form.
Any ideas?
I have a form in which I want to display the intermediaries (secretaries, PA's, receptionists etcetera) of our contacts.
Because some of these secretaries are important enough to us to count as contacts themselves, they are stored in our database as contacts in their own right.
And because it's possible that one person might act as an intermediary for many contacts, and one contact might have a few intermediaries, the relationship here is many to many.
So ... the relationship has to be stored with a junction table, and displayed on forms with a subform.
Rather than link the contact table straight back to itself through the junction table, I opted to create an extra link in the loop - building a table just for intermediaries, which uses the contact table ID field as a foreign key.
I've been building the subform with fields from the junction table. That worked fine.
I tried to proceed from there by making the subform's intermediaryID field a combo box - that pulled up the names of the people in the intermediary table rather than their ID numbers. This used the contact table[where the names are stored] and the intermediary table[which selects out the intermediaries] in the row source.
This hasn't worked. After I select an intermediary, when I click on something else I'm told that I "cannot add or change a record because a related one is required in the intermediaries table". The names I've selected belong to people who DO have records in the intermediaries table. My assumption is that the problem is that the link to the name is too indirect, since it isn't in the intermediaries table, but in the related contacts table. [The problem is the same if I take intermediaries out of the row source. - which has caused me troubles in the past]
I am avoiding the solution of putting the combo box in the intermediary table, and then pulling this up directly from the form.
Any ideas?