B
BatHawk
Help, I'm stuck!!!
I want users to be able to produce a report which lists the names of
those who meet certain criteria (i.e., the user selects up to 3 interests
using combo boxes and then produces a report which lists the names of
those who have those interests).
I can pull out all those who at least 1 or more of the interests selected,
but don't know how to write a query which
will return ONLY the names of those who have ALL the interests (i.e., to
exclude those who have less than the number of chosen interests)
PS: I thought i might be able to use the COUNT option to limit the result to
those who have all 3 interests only, but it all seems a bit beyond my skills
:-(
Tables as follows
tblContacts
Con_PK Con_Name etc, etc
7568 Smith
123 Jones
34569 Keen
tblInterest
Int_PK Int_Descrip
671234 Carpentry
1235 Gardening
1112 Plumbing
98356 Geology
tblInterest_Lookup
Lu_Con_FK Lu_Int_FK
7568 671234
123 1235
7568 1112
7568 98356
123 98356
select Con_Name as Contact, Int_Descrip as Interest from
(tblInterest JOIN tblInterest_Lookup ON tblInterest.Int_PK =
tblInterest_Lookup.Lu_Int_FK) INNER JOIN tbl_contacts ON
tblInterest_Lookup.Lu_Con_FK = tblContacts.Con_PK
where Int_Descrip like Forms!MyForm.cboInterest1 & "*" or
Int_Descrip like Forms!MyForm.cboInterest2 & "*" or
Int_Descrip like Forms!MyForm.cboInterest3 & "*"
I want users to be able to produce a report which lists the names of
those who meet certain criteria (i.e., the user selects up to 3 interests
using combo boxes and then produces a report which lists the names of
those who have those interests).
I can pull out all those who at least 1 or more of the interests selected,
but don't know how to write a query which
will return ONLY the names of those who have ALL the interests (i.e., to
exclude those who have less than the number of chosen interests)
PS: I thought i might be able to use the COUNT option to limit the result to
those who have all 3 interests only, but it all seems a bit beyond my skills
:-(
Tables as follows
tblContacts
Con_PK Con_Name etc, etc
7568 Smith
123 Jones
34569 Keen
tblInterest
Int_PK Int_Descrip
671234 Carpentry
1235 Gardening
1112 Plumbing
98356 Geology
tblInterest_Lookup
Lu_Con_FK Lu_Int_FK
7568 671234
123 1235
7568 1112
7568 98356
123 98356
select Con_Name as Contact, Int_Descrip as Interest from
(tblInterest JOIN tblInterest_Lookup ON tblInterest.Int_PK =
tblInterest_Lookup.Lu_Int_FK) INNER JOIN tbl_contacts ON
tblInterest_Lookup.Lu_Con_FK = tblContacts.Con_PK
where Int_Descrip like Forms!MyForm.cboInterest1 & "*" or
Int_Descrip like Forms!MyForm.cboInterest2 & "*" or
Int_Descrip like Forms!MyForm.cboInterest3 & "*"