Re: Coditional formatting

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Russ Kroeger wrote:
>It was actually the first two suggestions that got it to work also I moved
>the Null to the end of the expression and that did the trick. Now if I may
>ask another question.
>Now that I have the report working I am trying to get it to give me a total
>of all the reported values. When I create a text box and use the expression
>=sum([txtcarrchg]) the report produces a dialog box that asks for a
>parameter. If I enter 0 I get ths sum 0 on the report if I enter 2 it will
>report 2 times the number of records etc. Is it possible to get a sum of
>the values when using a conditional expression or am I trying to do
>something that is not possible.


The aggregate functions are not aware of controls on a
form/report, they only operate on fields in the record
source table/query. You can use them on an expression as as
long as all the terms are record source fields. Also note
that they ignore Null values.

Therefore, your problem is simply solved by using the
expression:

=Sum(IIf(IsNull([P/UCarrPdChk]), [P/UCarrChk], Null))
or
=Sum(SameExpressionAsTheTextbox)

--
Marsh
MVP [MS Access]
.



Relevant Pages

  • Re: Coditional formatting
    ... your spare time reading through previous threads in these ... >> Russ Kroeger wrote: ... >>>report 2 times the number of records etc. ... >> long as all the terms are record source fields. ...
    (microsoft.public.access.reports)
  • Re: Coditional formatting
    ... I have taken a beginner & ... >>Now that I have the report working I am trying to get it to give me a ... >>report 2 times the number of records etc. ... > long as all the terms are record source fields. ...
    (microsoft.public.access.reports)
  • Re: On Error - Query to Report - no records
    ... Avoid #Error in form/report with no records ... under each column for report. ... How do I hide the data ..ie #error and show only the label - or better ...
    (microsoft.public.access.queries)
  • Re: Where do I decalre vaiables whos scope will be global ?
    ... Whats the difference when you are making them? ... Module on a Report or Form. ... Modules are "part of" the Form/Report itself. ... if you see a Module in the db window then by definition it ...
    (microsoft.public.access.gettingstarted)
  • RE: Trouble adding records
    ... entering the data and the rest of the database because everything else worked. ... Start by making a backup of your mdb. ... Set the form/report Has Module property to No. ... No matter when I run the report, only the old info is included. ...
    (microsoft.public.access.forms)