Using If/When type expressions in a report

From: Saskatoon (anonymous_at_discussions.microsoft.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 16:08:05 -0700

Use an unbound text box
Set the control source to
=IIF([manager]=-1,[TOTALUNITS]*.7,SUM([UNITS]))

Make sure you use the names for your fields that appear on
the Name line of your text boxes, otherwise you will get
error messages.
For some reason Access uses -1 to mean yes and 0 to mean No
Hope this helps

>-----Original Message-----
>I want to create a field within a report based upon
>whether another field is true or false. Not only that,
>but I want to be able to calculate that field. For
>instance:
>
>Typically, the TOTALUNITS field would be calculated by
>using a =Sum[Units]expression. I want to be able to
>multiply the TOTALUNITS by .7 if another field (yes/no
>field) called MANAGER is = yes. Otherwise, I want to
just
>sum the field.
>
>I need to do this in the report.
>
>Any ideas?
>.
>



Relevant Pages

  • RE: writing records to a table
    ... It is an access report where the control source is the form. ... "Shari" wrote: ... The me.v fields are the unbound and the me. ... In the bound text box I have the control source set to table name. ...
    (microsoft.public.access.forms)
  • Re: Total a Sum Iff expression
    ... I would expect a control source in a Report or Group Header or Footer ... =Sum([Total Whelped Females]) ... Sum(), Avg, Countare aggregate functions. ...
    (microsoft.public.access.queries)
  • Re: summing a text box
    ... You can't Sum or Avg or Count etc... ... Report" field is unbound. ... Report Footer, unbound text controls with... ...
    (microsoft.public.access.reports)
  • Re: Report Sum Totals On Last Page
    ... "Duane Hookom" wrote: ... > All you should need is a couple text boxes in your Report Footer section. ... use a control source of: ... >> fix works to a degree for me, what I ultimately would like is just a sum ...
    (microsoft.public.access.reports)
  • Re: Summing Text Box
    ... >I'm guessing that the textbox showing this is in the ... >StaffTotal are fields in the report. ... >Below the Control Source set the Running Sum to Over All. ...
    (microsoft.public.access.reports)