Libre Base 5.1: Open Report based on current record

I have a form that allows a user to input PatientDetails, ConsultDetails (SubForm) and DispenseDetails (SubSubForm). I am now at point where I would like to print a report based on the current record in the form.

How do I specify a filter so that only a single Patient/Consult/Dispense Detail is shown?

Hi

You can use a macro that changes the query source of the report.

See FR.MACROS_Base_003_RapportParam.odb from my answer to this question

Regards

See an example database - Patients.odb

Your question regarding sub forms was answered by @frofa in which he said you need a sub form of the first sub form.

A Report has to be based on a single Table or Query as there is no equivalent of the sub form.

You need to base your Report on a Query as you need information from 3 Tables. As @PYS said in his reply you need to alter the Query that the Report is based on. The macro in my example does this. The button on the form runs the macro which first stores the PatientID of the selected record in a variable. The Query is then modified so the last WHERE clause on the PatientID is set to the value of the variable.

Thanks @peterwt . I have sent you my version of the odb. Hopefully it will clear up what I am trying to do.