G
gmazza via AccessMonster.com
Hey there,
I am trying to display the results I want on a form from a few tables based
on the ClinicalTrialId.
Here is my Record Source for my form:
SELECT PatientData.PatientId, PatientData.ClinicalTrialId, CriteriaOption.
CriteriaOptionValue, Criteria.CriteriaValue FROM Criteria INNER JOIN
(CriteriaOption INNER JOIN PatientData ON CriteriaOption.CriteriaOptionId =
PatientData.CriteriaOptionId) ON Criteria.CriteriaId = PatientData.
CriteriaId;
Right now ALL records from the PatientData table are showing up.
I only want records with ClinicalTrialId of 2 showing up.
I have a textbox on my form that is called ClinicalTrialId, and the value is
2.
When I add this to the end of my Record Source query,
Where ClinicalTrialId = Forms!PatientData!ClinicalTrialId
I get the error 'The field ClinicalTrialId could refer to more than 1 table
listed in the FROM clause of your SQL statement.
So when I add the table name to the ClinicalTrialId in the WHER clause, like:
Where PatientData.ClinicalTrialId = Forms!PatientData!ClinicalTrialId
no data shows up at all on the form. Same for when I add the other 2 table
names in front of ClinicalTrialId, nothing shows up.
If I put Where ClinicalTrialId = 2, then it works, I'm just not understanding
why it can't read my textbox?
Any thoughts?
I am trying to display the results I want on a form from a few tables based
on the ClinicalTrialId.
Here is my Record Source for my form:
SELECT PatientData.PatientId, PatientData.ClinicalTrialId, CriteriaOption.
CriteriaOptionValue, Criteria.CriteriaValue FROM Criteria INNER JOIN
(CriteriaOption INNER JOIN PatientData ON CriteriaOption.CriteriaOptionId =
PatientData.CriteriaOptionId) ON Criteria.CriteriaId = PatientData.
CriteriaId;
Right now ALL records from the PatientData table are showing up.
I only want records with ClinicalTrialId of 2 showing up.
I have a textbox on my form that is called ClinicalTrialId, and the value is
2.
When I add this to the end of my Record Source query,
Where ClinicalTrialId = Forms!PatientData!ClinicalTrialId
I get the error 'The field ClinicalTrialId could refer to more than 1 table
listed in the FROM clause of your SQL statement.
So when I add the table name to the ClinicalTrialId in the WHER clause, like:
Where PatientData.ClinicalTrialId = Forms!PatientData!ClinicalTrialId
no data shows up at all on the form. Same for when I add the other 2 table
names in front of ClinicalTrialId, nothing shows up.
If I put Where ClinicalTrialId = 2, then it works, I'm just not understanding
why it can't read my textbox?
Any thoughts?