Show phrase when no data for a report

F

FloodEbb

I have followed several threads on this subject which suggest using the IIf
statement in a new text box. Some suggest the IIf should be on a particular
field and some suggest on the report itself.

I am unable to get the required result and wonder when using a text box for
the control source (to enter the IIF statement in to), where it should be
placed on the report.

Specifically my report is named "DR Diving Record Rpt" and a field from it
is "ship"
I have tried adding a text box with the following
=IIf([DR Diving Record Rpt].[Report].[HasData], Null, "No ships today")
and also tried
=IIf([Ship] Is Null, "No Ships today", [Ship])

Any help please, thanks
 
S

Steve

Try this:
=IIf(IsNull([Ship]), "No Ships today", [Ship])

Steve
(e-mail address removed)
 
M

Marshall Barton

FloodEbb said:
I have followed several threads on this subject which suggest using the IIf
statement in a new text box. Some suggest the IIf should be on a particular
field and some suggest on the report itself.

I am unable to get the required result and wonder when using a text box for
the control source (to enter the IIF statement in to), where it should be
placed on the report.

Specifically my report is named "DR Diving Record Rpt" and a field from it
is "ship"
I have tried adding a text box with the following
=IIf([DR Diving Record Rpt].[Report].[HasData], Null, "No ships today")

That should work if the text box is on the main report and
[DR Diving Record Rpt] is a subreport control in the same
section. Note that the name of the subreport control may be
different from the name of the report object it contains.

Since you did not mention a subreport, I am wonering if all
this is happening on a single report. If so, the expression
should be:
=IIf(Report.HasData, Null, "No ships today")
 
F

FloodEbb

Many thanks to you both, I now have the required results.

It does all boil down to getting the correct code in a text box on the
correct part of the report (or sub-report)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top