Print None on a Report

  • Thread starter Thread starter JD McLeod
  • Start date Start date
J

JD McLeod

I have a report which prints audit procedures. On this report is a subreport
which prints the findings and recommendations. The data source for the
subreport is a table called “FindingsTableâ€. The field with the finding in
that table is called “Findingâ€. Currnetly, the user has to enter into a form
each section they audited and if there were no findings, they have to enter
the word “Noneâ€. I want the report to print the word “None†for them so that
they don’t have to set up a finding. This way, they would only have to enter
something in the form if they actually had a finding. This is because, all
audit sections have to print, regardless of whether or not there are findings.

What I have tried is this. In the report field for the finding, I entered
the following
Iif(IsNull([Finding]),â€Noneâ€,[Finding])
Where [Finding] is the name of the field within the FindingsTable that I want.
It is returning the #Error on my report. Any help on the syntax or what I
am doing wrong. Initially, I realized that the control on the form was also
named Finding, but I went in and changed that and it still gives me the same
error. I also tried:
Iif([Finding]=Null,â€Noneâ€,[Finding])

Thanks.
 
=IIf([Finding] Is Null, "None", [Finding])

If it's possible for [Finding to contain a zero length string;

=IIf(Nz([Finding], "")="", "None", [Finding])
 
JD said:
I have a report which prints audit procedures. On this report is a subreport
which prints the findings and recommendations. The data source for the
subreport is a table called “FindingsTable”. The field with the finding in
that table is called “Finding”. Currnetly, the user has to enter into a form
each section they audited and if there were no findings, they have to enter
the word “None”. I want the report to print the word “None” for them so that
they don’t have to set up a finding. This way, they would only have to enter
something in the form if they actually had a finding. This is because, all
audit sections have to print, regardless of whether or not there are findings.


A subreport with no records will not display anything so
trying to get it to display None won't work. However, it's
easy to get a main report text box to display something when
the subreport has nothing to report. The simplest is to put
a text box at an appropriate place on the main report
(usually on top of the subreport) and set its expression to
something like:
=IIf(thesubreport.Repot.HasData, Null, "None")
 
Thanks, I tried that and it didn't work. I am probably not doing a good job
of explaining how i have my report set up. The findings in the report are in
a subreport. that subreport is simply printing all of the entries in the
findings table. So if someone doesn't enter a finding for a particular audit
section, then not only is the finding absent from the table, but also the
audit section. Since the audit section is what links the subform to the
parent form, i guess i would have to enter something in order to get anything
to print. any other thoughts. thanks and i saved the syntax for future use.

Beetle said:
=IIf([Finding] Is Null, "None", [Finding])

If it's possible for [Finding to contain a zero length string;

=IIf(Nz([Finding], "")="", "None", [Finding])

--
_________

Sean Bailey


JD McLeod said:
I have a report which prints audit procedures. On this report is a subreport
which prints the findings and recommendations. The data source for the
subreport is a table called “FindingsTableâ€. The field with the finding in
that table is called “Findingâ€. Currnetly, the user has to enter into a form
each section they audited and if there were no findings, they have to enter
the word “Noneâ€. I want the report to print the word “None†for them so that
they don’t have to set up a finding. This way, they would only have to enter
something in the form if they actually had a finding. This is because, all
audit sections have to print, regardless of whether or not there are findings.

What I have tried is this. In the report field for the finding, I entered
the following
Iif(IsNull([Finding]),â€Noneâ€,[Finding])
Where [Finding] is the name of the field within the FindingsTable that I want.
It is returning the #Error on my report. Any help on the syntax or what I
am doing wrong. Initially, I realized that the control on the form was also
named Finding, but I went in and changed that and it still gives me the same
error. I also tried:
Iif([Finding]=Null,â€Noneâ€,[Finding])

Thanks.
 
If i understand correctly, if there are no records for the
subreport you want it to display "None". If that's the case
I'm not sure how you would do that, or if it can be done.

Have you tried using a query of the two tables as the
record source for your report with the Audit info in
a group header and the findings in the detail section
instead of using a subreport? If you did that, the IIf
statement in the Control Source of the Findings text
box should work.

--
_________

Sean Bailey


JD McLeod said:
Thanks, I tried that and it didn't work. I am probably not doing a good job
of explaining how i have my report set up. The findings in the report are in
a subreport. that subreport is simply printing all of the entries in the
findings table. So if someone doesn't enter a finding for a particular audit
section, then not only is the finding absent from the table, but also the
audit section. Since the audit section is what links the subform to the
parent form, i guess i would have to enter something in order to get anything
to print. any other thoughts. thanks and i saved the syntax for future use.

Beetle said:
=IIf([Finding] Is Null, "None", [Finding])

If it's possible for [Finding to contain a zero length string;

=IIf(Nz([Finding], "")="", "None", [Finding])

--
_________

Sean Bailey


JD McLeod said:
I have a report which prints audit procedures. On this report is a subreport
which prints the findings and recommendations. The data source for the
subreport is a table called “FindingsTableâ€. The field with the finding in
that table is called “Findingâ€. Currnetly, the user has to enter into a form
each section they audited and if there were no findings, they have to enter
the word “Noneâ€. I want the report to print the word “None†for them so that
they don’t have to set up a finding. This way, they would only have to enter
something in the form if they actually had a finding. This is because, all
audit sections have to print, regardless of whether or not there are findings.

What I have tried is this. In the report field for the finding, I entered
the following
Iif(IsNull([Finding]),â€Noneâ€,[Finding])
Where [Finding] is the name of the field within the FindingsTable that I want.
It is returning the #Error on my report. Any help on the syntax or what I
am doing wrong. Initially, I realized that the control on the form was also
named Finding, but I went in and changed that and it still gives me the same
error. I also tried:
Iif([Finding]=Null,â€Noneâ€,[Finding])

Thanks.
 
If you want to print/display something on the main report from a subreport
and it's possible the subreport might not return any matching records, you
can use:

=IIf(sbrptCtrl.Report.HasData, sbrptCtrl.Report.[Finding],"No Findings")
 
Back
Top