D
DocBrown
I have two tables where there is a one to many relation to the secondary
table. The secondary table also has a related lookup table that translates an
ID to a text field (to allow for an editable text list):
Primary - volunteers:
VolunteerID
First Name
Last Name
(etc)
Secondary - VolunteerFocus:
RecID
VolunteerID
TypeID
Lookup - FocusList:
TypeID
VolunteerFocus
I want to extract records where the selection can consist of multiple
VolunteerFocus. The following query gets the data I'm after. Eventually, the
'In' criteria will be derived from a form and substituted into the query.
SELECT Volunteers.*, VolunteerFocus.TypeID, FocusList.VolunteerFocus
FROM Volunteers INNER JOIN
(FocusList INNER JOIN VolunteerFocus ON
FocusList.TypeID = VolunteerFocus.TypeID)
ON Volunteers.VolunteerID = VolunteerFocus.VolunteerID
WHERE (((FocusList.VolunteerFocus) In ("birthday party","parent/child")));
If I display this as datasheet, and a volunteer has both of the focuses,
then I see multiple records:
Fred Thompson 1 'Birthday party'
Fred Thompson 2 'parent/child'
Susan Smith 1 'Birthday party'
I want to display this in a form like:
Fred Thompson Birthday Party
(Fred's data) parent/child
Susan Smith Birthday party
(Susan's data)
or maybe this way:
Birthday party: Fred Thompson
Susan Smith
parent/child: Fred Thompson
What is the approach to setup the form to do this? I assume I'll use sub
forms but I'm not sure how to reference the fields and link the sub forms to
do this. Any ideas are really appreciated.
John S.
table. The secondary table also has a related lookup table that translates an
ID to a text field (to allow for an editable text list):
Primary - volunteers:
VolunteerID
First Name
Last Name
(etc)
Secondary - VolunteerFocus:
RecID
VolunteerID
TypeID
Lookup - FocusList:
TypeID
VolunteerFocus
I want to extract records where the selection can consist of multiple
VolunteerFocus. The following query gets the data I'm after. Eventually, the
'In' criteria will be derived from a form and substituted into the query.
SELECT Volunteers.*, VolunteerFocus.TypeID, FocusList.VolunteerFocus
FROM Volunteers INNER JOIN
(FocusList INNER JOIN VolunteerFocus ON
FocusList.TypeID = VolunteerFocus.TypeID)
ON Volunteers.VolunteerID = VolunteerFocus.VolunteerID
WHERE (((FocusList.VolunteerFocus) In ("birthday party","parent/child")));
If I display this as datasheet, and a volunteer has both of the focuses,
then I see multiple records:
Fred Thompson 1 'Birthday party'
Fred Thompson 2 'parent/child'
Susan Smith 1 'Birthday party'
I want to display this in a form like:
Fred Thompson Birthday Party
(Fred's data) parent/child
Susan Smith Birthday party
(Susan's data)
or maybe this way:
Birthday party: Fred Thompson
Susan Smith
parent/child: Fred Thompson
What is the approach to setup the form to do this? I assume I'll use sub
forms but I'm not sure how to reference the fields and link the sub forms to
do this. Any ideas are really appreciated.
John S.