This is a thorny issue: if every record in the household has a PrimaryMember
field, does your structure introduce the possiblity of being inconsistent?
Would it be wrong if one member has someone as the primary member, yet
another person in the same household has another person as the primary
member? If so, you might consider a different design.
Here's an alternative:
People in households and companies - modelling human relationships
at:
http://allenbrowne.com/AppHuman.html
Download the sample database, and see if it does what you need. tblGroup is
a household. tblGroupClient contains the members of the household, and each
member has a role. By assigning a priority to each role (in tblRole), you
could derive who is the primary member of the household.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I've got a table (tblHouseholds) consisting of address information with an
> additional field that stipulates the PrimaryMember (head of the household
[quoted text clipped - 29 lines]
>
> dbqph
dbqph - 20 Nov 2007 14:21 GMT
Allen,
Thank you for the insight. I reviewed your application and hope an alternate
solution exists that wouldn't require me to re-design the structure of the
database.
I chose the design structure primarily for simplicity (figuring that if each
household has a primary member the value of that member should be stored in
the household table). The problem is that this value can't be determined
until:
1. a household has been created, then,
2. a member of the household has been created.
Your approach in the sample application appears that it could solve the
problem I'm facing. However, short of the Household/PrimaryMember
relationship, no other roles within the context of the Household/Member
relationship are foreseen.
Perhaps I should consider a third table (in the vein of your structure) that
contains HouseholdID and PrimaryMember with each field set to Entry Required
= Yes and Indexed, No Duplicates?
--
Ladd Nelson
> This is a thorny issue: if every record in the household has a PrimaryMember
> field, does your structure introduce the possiblity of being inconsistent?
[quoted text clipped - 10 lines]
> member has a role. By assigning a priority to each role (in tblRole), you
> could derive who is the primary member of the household.
<snip>
I was able to arrive at my desired results by making a temporary table and
then running an update query using the temporary table rather than trying to
do it all on-the-fly:
qryMakeTemp:
SELECT tblMembers.HouseholdID, First(tblMembers.MemberID) AS FirstOfMemberID
INTO tblOKToDelete
FROM tblMembers
GROUP BY tblMembers.HouseholdID;
qryUseTemp:
UPDATE tblHouseholds LEFT JOIN tblOKToDelete ON tblHouseholds.HouseholdID =
tblOKToDelete.HouseholdID SET tblHouseholds.PrimaryMember =
tblOKToDelete.FirstOfMemberID
WHERE (((tblHouseholds.PrimaryMember) Is Null Or
(tblHouseholds.PrimaryMember)=0));
I then used a bit of code to run the routines as needed by the user:
Public Function GetSetPrimaryMembers()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryMakeTemp"
DoCmd.OpenQuery "qryUseTemp"
DoCmd.DeleteObject acTable, "tblOKToDelete"
DoCmd.SetWarnings True
End Function
I'm sure there are more sophisticated approaches to the problem, but this
seems to be the most painless for what I'm trying to accomplish.
dbqph
> I've got a table (tblHouseholds) consisting of address information with an
> additional field that stipulates the PrimaryMember (head of the household
[quoted text clipped - 27 lines]
>
> dbqph