How suppress detail line if condition met

S

SteveL

How can I suppress the printing of a line of detail on a
report if a certain condition is met on that line? In
other words, I have a calculated field on the line and if
the answer is <=0 then I want the entire line of detail
suppressed.

--Steve
 
F

Fons Ponsioen

The way I would approach that is to base the report on a
query and simply filter the query.
Hope that helps.
Fons
 
E

Eric

If filtering at the query level as suggestted in the
previous reply doesn't work for you, set up each textbox
on the detail line to be something like this:

=IIf([Answer]<=0,"",[FieldToShow])

Set CanShrink = Yes for both the textbox and detail
level. If you have labels on the line as well, you'll
need to change them to textboxes like this:

=IIf([Answer]<=0,"","LabelToShow")

With this approach, everything on the detail line should
be blank if the answer is <= 0. All of the textboxes
will shrink to nothing along with the entire detail level
and effectively make the line disappear from your
report. HTH....Eric
 
R

Rod

You might also be able to suppress that in the query.
Create the calculated field in the query and then use your
criteria to eliminate those lines.

Select fielda, fieldb, fieldc, (fielda + fieldb)*fieldc
from table1
Where ((fielda + fieldb)*fieldc)>0
 

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