I'm relatively new to Access but have some experience working with relational database structures. I'm completely stuck on what seems like a simple task.
Here's the scenario:
I have two tables, People and Relationships. The People table has a primary key, personID, as well as first and last name fields.
The Relationships table has two foreign key fields, personID1 and personID2, as well as a relationshiptype field.
As an example of what I want to accomplish, say we have a person who is a student, Lisa Smith. That person has a relationship with another person, Jerry Smith, who is her father. She also has a relationship with Michele Brian, who is her teacher.
I'd like my subform to show the following:
Jerry Smith Parent
Michele Brian Instructor
Instead, what I'm getting is:
Lisa Smith Parent
Lisa Smith Instructor
I know exactly what's happening--the form is displaying the name based on the personID of the record that's currently open, rather than the personID2 of the relationships table (the relate-ee, if you will).
This seems like something that I should be able to do using the form-building tools, rather than having to write a custom query.
I am somewhat proficient in SQL, but I'm not sure how to write this one in the context of using it in a subform.
Could someone point me in the right direction?
Thanks,
Josh