K
Kurt
I have two synchronized combo boxes so that when a
patient is selected in the first box, a second combo box
is requeried so that it lists only cases for that
patient. (A patient can have one or more cases.) The user
can then select a case in the second combo box to pull up
the record.
If the patient has one case, then that one case is listed
in the second combo box. Great. But if the patient has,
for example, two cases, *four* items are listed in the
second combo box (two instances of each case). I've tried
playing around with DISTINCT vs DISTINCT ROW to no avail.
How can avoid these duplicates?
The first combo box (cboFindPatient) is based on:
SELECT tblPatients.PatientName, tblPatients.PatientID
FROM tblPatients
ORDER BY tblPatients.PatientName;
The second combo box (cboFindCase) is based on:
SELECT DISTINCT tblCases.CaseNumber,
tblCases.CaseDate, qryMedicalIntake.PatientID,
qryMedicalIntake.*
FROM qryMedicalIntake INNER JOIN tblCases ON
qryMedicalIntake.PatientID = tblCases.PatientID
WHERE
(((qryMedicalIntake.PatientID)=[Forms]!
[frmMedicalIntake]![cboFindPatient]))
ORDER BY tblCases.CaseNumber;
Thanks. - Kurt
patient is selected in the first box, a second combo box
is requeried so that it lists only cases for that
patient. (A patient can have one or more cases.) The user
can then select a case in the second combo box to pull up
the record.
If the patient has one case, then that one case is listed
in the second combo box. Great. But if the patient has,
for example, two cases, *four* items are listed in the
second combo box (two instances of each case). I've tried
playing around with DISTINCT vs DISTINCT ROW to no avail.
How can avoid these duplicates?
The first combo box (cboFindPatient) is based on:
SELECT tblPatients.PatientName, tblPatients.PatientID
FROM tblPatients
ORDER BY tblPatients.PatientName;
The second combo box (cboFindCase) is based on:
SELECT DISTINCT tblCases.CaseNumber,
tblCases.CaseDate, qryMedicalIntake.PatientID,
qryMedicalIntake.*
FROM qryMedicalIntake INNER JOIN tblCases ON
qryMedicalIntake.PatientID = tblCases.PatientID
WHERE
(((qryMedicalIntake.PatientID)=[Forms]!
[frmMedicalIntake]![cboFindPatient]))
ORDER BY tblCases.CaseNumber;
Thanks. - Kurt