Ok, I am completely new to MS Access. I took one class on databases and it was the basics. I am trying to create a parameter query that uses three tables. I am selecting questions based on their source and/or their historical era. This is the SQL that I have so far. It will retrieve info only if I use both the Source and the Historical Era, but not if I only choose one. If anybody could give me any help, I would appreciate it.
PARAMETERS [Source ] Text ( 255 ), HistoricalEra Text ( 255 );
SELECT Answer.AnswerText, Answer.CorrectAnswer, [Historical Era].HistoricalEra, Question.QuestionText, Question.NationallyValidated, Source.Source
FROM (Source INNER JOIN ([Historical Era] INNER JOIN Question ON [Historical Era].[HistoricalEraID] = Question.[HistoricalEraID]) ON Source.[SourceID] = Question.[SourceID]) INNER JOIN Answer ON Question.[QuestionID] = Answer.[QuestionID]
WHERE (((Source.Source)=[Source]) AND ((Historical Era.HistoricalEra)=[HistoricalEra]))
OR (((Historical Era.HistoricalEra)=[HistoricalEra]) AND (([Source]) Is Null))
OR (((Source.Source)=[Source]) AND (([HistoricalEra]) Is Null))
OR ((([Source]) Is Null) AND (([HistoricalEra]) Is Null));
Kimmie