Conditional Sub-Report

racer25

Slowly Getting There
Local time
Today, 16:13
Joined
May 30, 2005
Messages
65
Hi

I have a sub-report display on the report correctly ..... to a point.

If there is no data in the sub-report then I would like it to display a field from the Master field list.

If Data Present use sub-report else use RCP_NARRATIVE.

The database produces receipts and if we allocate funds the sub-report displays the invoices funds were allocated if funds were left unallocated it should print the Narrative.

Is this possible?

Thanks in advance.

R
 
Need more info. Of course it's possible, but the question is too vague.
 
Need more info. Of course it's possible, but the question is too vague.

You can possibly see from the number of posts that I am no expert.... meet me half way and a little bit of a pointer as to what else would be useful, maybe I might get it right next time.

The subreport is on the detail line of the main report. If the subreport has some data then show the subreport else show a field from the main report.

Cheers,

R
 
The subreport is on the detail line of the main report. If the subreport has some data then show the subreport else show a field from the main report.
It's not that simple racer. It depends.

What is the source of the sub? A query? Nothing? If the source is a datasheet (either a query or a table), you do it one way. If there is no source, and you just have a bunch of controls sitting around with data that is pulled from other places in the database, then you do this another way.

Give me more info on this.
 
It's not that simple racer. It depends.

What is the source of the sub? A query? Nothing? If the source is a datasheet (either a query or a table), you do it one way. If there is no source, and you just have a bunch of controls sitting around with data that is pulled from other places in the database, then you do this another way.

Give me more info on this.

About 30 mins ago, I got it working maybe not the best way but its working.

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me!SubInsurer.Visible = Me!SubInsurer.Report.HasData
Me.RCP_NARRATIVE.Visible = (Me!SubInsurer.Report.HasData + 1)
End Sub

This is in the OnFormat Property of the detail line.

The SubReport is a SubReport from a query.
 

Users who are viewing this thread

Back
Top Bottom