View Full Version : Access Report with sub-reports(dont display empty sub-reports)


mjmx1
12-07-2009, 11:35 PM
Hi

I have 2 sub-reports within a main report... on occasion the sub-reports are empty but still display blank pages how can I avoid this please?

The sub-reports are charts , i have tried replacing sub-report charts by using the insert chart menu option, but still cant 'hide' blank charts.

Any advice would be most appreciated.

Thanks

MJMX1

RuralGuy
12-08-2009, 03:10 PM
How about using the OpenEvent of the SubReport to set Me.Visible as False if Me.Recordset.RecordCount = 0

mjmx1
12-08-2009, 10:07 PM
Hi

Understand what you're saying but get the following message when i now run the report:

run time error '2593' This feature is not available in an MDB.

I have seen something about an 'onnodata' property ... will investigate that.

Thanks for responding.

mjmx1

Rich
12-08-2009, 10:58 PM
Search here for HasData, many examples have been posted over the years

JANR
12-08-2009, 11:07 PM
Isen't the No_Data Event better?

Private Sub No_Data(Cancel As Integer)
Me.Visible = False
End Sub

JR

mjmx1
12-09-2009, 11:33 PM
I'll investigate all suggestions..

Many Thanks