Maybe you could define a calculated field in the logbook file that creates what you'd like to see in the patient file. Then display that in your porthole?
I recommend placing each Procedure in a separate log record. Each record would have a Patient ID field that controls what records are visible in your portal (you have that already, I believe). You would use your CaseID field to identify all log records that are from the same case. Now add an additional field (This can be a serial number field) that uniquely identifies each log record.
Now set up your portal to sort all portal records first by CaseID and then by the new LogID field. Sorting on the first field will cluster the procedures by CaseID the subsequent sort by LogID will but them in their original data-entry order. If each logged procedure has date/time data, you may be able to avoid using the additional LogID field, and just add the date and time or timestamp fields to your sort order.
Thanks for the suggestions but I don't think I explained all of the relationships properly. Each patient referenced in both databases has a unique reference number. If I have got this right then the portal should use this to get all procedures from the other "Logbook". I think that the problem I have is that in patients who have had multiple separate entries in the logbook file (multiple visits to theatre), some of which have multiple procedures in a single visit, the portal generates multiple related records rather than a single related record for each line in the portal.
I don't think I am explaining this well.
As an example, in one case there is a patient who has had 2 visits to the operating room. On one visit 2 procedures were carried out and on the second one procedure was carried out. If I set the portal to use the relationship "Logbook" then 2 procedures are listed. The second procedure from the first visit is not shown. If the other relationship (Procedure) is used then 3 procedures are listed, which is what I want to see. The problem then is that related records are not unique and the date of the latest is shown against all procedures, rather than the date for that particular record. Other records are also placed against each procedure from other tables in the same file which seem to behave normally.
Do relationships to external files behave differently? Sorry if this makes little sense. I will try to clarify if necessary.
It's always a challenge to recommend solutions when we don't know the exact structure of your tables, fields and relationships. :smileywink:
"The problem then is that related records are not unique" That's a key problem. Each procedure record should have a unique ID. An auto-entered serial number may be a useful way to do this. In addition, the combination of date and procedure name should also be unique for each logged procedure. Keep in mind that you can have multiple key fields in your procedure table. One key can identify the patient, another the specific hospital visit and a third can uniquely identify the specific procedure.
"... and the date of the latest is shown against all procedures, rather than the date for that particular record." I can't tell from your post why this would be the case. The date of each procedure should be stored in the procedure record and should be specified during data entry when it is "logged".
Perhaps you could layout for us the tables and relationships involved?
Thanks again for the suggestions. I have actually worked out how to fix this myself. I think explaining it helped me to see where the problem was.
As long as it works for you and you understand how/why it works--that's what really matters.