Ask Your Question

Libre Base 5.1: Open Report based on current record

asked 2016-03-05 09:24:18 +0200

hmadhi gravatar image

updated 2016-03-07 12:25:16 +0200

Alex Kemp gravatar image

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?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-03-05 11:47:14 +0200

pierre-yves samyn gravatar image


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


edit flag offensive delete link more

answered 2016-03-07 11:20:05 +0200

peterwt gravatar image

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 @pierre-yves samyn 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.

edit flag offensive delete link more


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

hmadhi gravatar imagehmadhi ( 2016-03-07 15:41:12 +0200 )edit
Login/Signup to Answer

Question Tools



Asked: 2016-03-05 09:24:18 +0200

Seen: 768 times

Last updated: Mar 07 '16