displaying message on the report when no data is present

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

First of all thanks to AlCamp for providing me a solution to an earlier
problem.

I have generated a report basing on a query which gives me the
number of cases as the result. Here I'm trying to display the same on the
report, but what I want to do is, if the number of cases are less than 5, I
want to display as "not sufficient data" on the report.
I got it with the help of a unbound text control alongside the textbox with
the following code:
= IIF(TotalCases < 5, "Insufficient Data",""

The problem is along with the text, the data is also getting displayed and
what can be done to stop displaying the data when text is displayed
satisfying the condition.

Thanks for any help
-talktobatchu
 
talktobatchu said:
First of all thanks to AlCamp for providing me a solution to an earlier
problem.

I have generated a report basing on a query which gives me the
number of cases as the result. Here I'm trying to display the same on the
report, but what I want to do is, if the number of cases are less than 5, I
want to display as "not sufficient data" on the report.
I got it with the help of a unbound text control alongside the textbox with
the following code:
= IIF(TotalCases < 5, "Insufficient Data",""

The problem is along with the text, the data is also getting displayed and
what can be done to stop displaying the data when text is displayed
satisfying the condition.


Add a line of code to the Format event of the section
containing the total cases text box:

Me.TotalCases.Visible = (Me.TotalCases >= 5)
 
thanks Marshall for the suggestion, but when I write the piece of code into
the Format section of the textbox of TotalCases, the whole code is being
printed on the report instead of hiding it.

guess there should be some other way to do this.
talktobatchu
 
What do you mean by "the whole code"?

Are you sure the data is a number?

If I understand what you want an what data you're working
with, you might want to do all this with a single text box
using the expression:

=IIF(TotalCases < 5, "Insufficient Data", TotalCases)
 
Back
Top