Subreport not printing if blank (1 Viewer)

Angel69

Registered User.
Local time
Yesterday, 21:06
Joined
Jun 11, 2013
Messages
86
Hi,

I have a report with four subreports. If the subreports have no data I have a formula to put the word 'none' in the first field as follows:

=IIf(IsNull([Question]),"None",[Question])

I do a print preview and the word 'None' shows up and subreport looks good when I view just the subreport as well as when I view the full report.

When I print the subreport the text '#Error' prints. When I print the full report I just get a blank space.

I need the subreport to print with the word 'None' if there is not data. How do I accomplish? I tried the above formula both in the query and in the control source of the report. It just comes up blank when I put it in the query.

TIA
 

pr2-eugin

Super Moderator
Local time
Today, 02:06
Joined
Nov 30, 2011
Messages
8,494
There is an event "On No Data", try playing with that !
 

Angel69

Registered User.
Local time
Yesterday, 21:06
Joined
Jun 11, 2013
Messages
86
I've tried searching for more info. on the 'On no data' with no luck. The post I've found were folks looking to cancel a report if it was blank.

I did find something on the MS site at http://answers.microsoft.com/en-us/...-records/0631e68d-45fc-4fcc-b49c-a8944bc47906

I put
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.[txt_Gap1].Visible = Not Me.[subTemplateDocGaps].Report.HasData
End Sub

in the On Format event but getting error that Microsoft Access can't find the field '|1' referred to in your expression

Any suggestions?
 

Users who are viewing this thread

Top Bottom