SQL Question/Help

avagodro

New member
Local time
, 21:17
Joined
Sep 9, 2005
Messages
8
I have a reference in a form that is starting to drive me crazy. Usually I can resolve this, but maybe its from having a long week and not thinking clearly.
Anyway, in the query I have the following tables:

tblResponses
-AssociateRef
-QstnID
-Chosen Value
-ResponseDate

tblResponsesList
-QstnID
-Choices

Here is the SQL that I have, then I will explain my dilema:

SELECT DISTINCTROW tblResponsesList.Choices, tblResponses.[Chosen Value]
FROM tblResponses RIGHT JOIN tblResponsesList ON tblResponses.[Chosen Value] = tblResponsesList.Choices
WHERE (((tblResponses.[Chosen Value]) Is Null) AND ((tblResponsesList.QstnID)=[Form].[QstnID]))
ORDER BY tblResponsesList.Choices;

This SQL is the Row Source for the first of two listboxes. It was working fine, until it came to a Questions with the same choices (True or False), even though it was a different QstnID.
I am thinking that what is needed is the right join, as it is, check the QstnID from tblResponsesList with [Form].[QstnID] as it is now, but also check [QstnID] from tblResponses. If the QstnID exists, then it would filter it.
I'm not sure. I'm at a bit of a loss here. Any suggestions?
 

Users who are viewing this thread

Back
Top Bottom