Sorting multiple subreports into 1 report

rrtpeds

Registered User.
Local time
Today, 09:59
Joined
Apr 17, 2008
Messages
11
So here is the deal.
I have a database built that tracks patients in a hospital. Each patient has up to 8 reports possible but only 1 report will be used at a time. So the report is built and at this point what happens is each patients information which takes up half a page has been printed seperately. I would like to be able to print 2 per page. First solution I came up with was to create an active check box that would determine if the report should be active. Now the question is how do i write an IIF statement or other way to evaluate and place a report in only if the active box is checked.
 
what i do is have a form with a number of checkboxes, which could be say, patient history, xray history, current medications... etc - each one for a different subreport of yours. then, in the main report section's "on format" event (so, the same section where you have your subreports, like the detail section) have code which states which subreports are visible and which aren't.

here's some code i have in a horse database, maybe you can manipulate it for your own purposes (my subreports are in the report footer section):

Code:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

    If Forms!frmHorse.chkMassage_Observations = False Then
        rptHorseMassage_Observations.Visible = False
    End If

    If Forms!frmHorse.chkMassage_recommendations = False Then
        rptHorseMassage_Recommendations.Visible = False
    End If
    
    If Forms!frmHorse.chkMassage_glossary = False Then
        rptHorseMassage_Glossary.Visible = False
    End If

End Sub

is this what you mean?
 

Users who are viewing this thread

Back
Top Bottom