OK, this might be tricky to explain but I'll try.
I have a Form which has a Sub Form and that Sub Form has 2 Sub Forms.
frm_Patient
---frm_Appointment
------frm_Blood_Pressure
------frm_Pulse_Rate
A patient can have many appointments. An appointment does not have to have a Blood Pressure record or a Pulse rate record related to it. For each Blood Pressure and Pulse Rate record, I have a check box which is checked for the "optimum result". The data in the tables might look like that shown below.
Patient1
---Appointment1
------Blood_Pressure1
------Blood_Pressure2 x
------Blood_Pressure3
------Pulse_Rate1 x
------Pulse_Rate2
Patient2
---Appointment2
------Blood_Pressure4
------(no Pulse_Rate records)
Patient3
---Appointment3
------(no Blood_Pressure records)
------Pulse_Rate3
Patient4
---Appointment4
------(no Blood_Pressure records)
------(no Pulse_Rate records)
The query on the data above is returning 9 records as I would expect.
Appointment1 Blood_Pressure1 Pulse_Rate1
Appointment1 Blood_Pressure1 Pulse_Rate2
Appointment1 Blood_Pressure2 Pulse_Rate1
Appointment1 Blood_Pressure2 Pulse_Rate2
Appointment1 Blood_Pressure3 Pulse_Rate1
Appointment1 Blood_Pressure3 Pulse_Rate2
Appointment2 Blood_Pressure4 (no data)
Appointment3 (no data) Pulse_Rate3
Appointment4 (no data) (no data)
but, the problem is, I only want the query to return MOST RECENT appointment for each patient and only the red records of each appointment.
I have tried putting a "-1" in the criteria in the Optimum_Result" field, but this then disregards the other records.
I really am stuck. Can anyone help ???
Thanks
Al
I have a Form which has a Sub Form and that Sub Form has 2 Sub Forms.
frm_Patient
---frm_Appointment
------frm_Blood_Pressure
------frm_Pulse_Rate
A patient can have many appointments. An appointment does not have to have a Blood Pressure record or a Pulse rate record related to it. For each Blood Pressure and Pulse Rate record, I have a check box which is checked for the "optimum result". The data in the tables might look like that shown below.
Patient1
---Appointment1
------Blood_Pressure1
------Blood_Pressure2 x
------Blood_Pressure3
------Pulse_Rate1 x
------Pulse_Rate2
Patient2
---Appointment2
------Blood_Pressure4
------(no Pulse_Rate records)
Patient3
---Appointment3
------(no Blood_Pressure records)
------Pulse_Rate3
Patient4
---Appointment4
------(no Blood_Pressure records)
------(no Pulse_Rate records)
The query on the data above is returning 9 records as I would expect.
Appointment1 Blood_Pressure1 Pulse_Rate1
Appointment1 Blood_Pressure1 Pulse_Rate2
Appointment1 Blood_Pressure2 Pulse_Rate1
Appointment1 Blood_Pressure2 Pulse_Rate2
Appointment1 Blood_Pressure3 Pulse_Rate1
Appointment1 Blood_Pressure3 Pulse_Rate2
Appointment2 Blood_Pressure4 (no data)
Appointment3 (no data) Pulse_Rate3
Appointment4 (no data) (no data)
but, the problem is, I only want the query to return MOST RECENT appointment for each patient and only the red records of each appointment.
I have tried putting a "-1" in the criteria in the Optimum_Result" field, but this then disregards the other records.
I really am stuck. Can anyone help ???
Thanks
Al
Last edited: