[AccessD] Pass, Fail or Null

Nicholson, Karen cyx5 at cdc.gov
Tue Oct 18 05:53:32 CDT 2005


I never thought of a dcount.  Daaah!  Thank you so much. 


Karen S. Nicholson
Programmer Analyst
EG&G Technical Services, Inc.
Pittsburgh, PA
Phone: 412-386-6649
Email: cyx5 at cdc.gov


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.Tejpal
Sent: Monday, October 17, 2005 2:47 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Pass, Fail or Null

Karen,

    Apparently, you are seeking the following display in a calculated
text box on the main form, depending upon the status of records in
subform.
    (a) Failed - If even one of the records has zero as result. (In
addition, there may be many other records where result is Null or other
than zero).
    (b) Passed - If no record has zero result, but at least one or more
records carry a definite value for the result, other than zero. (In
addition, there may be many other records where result is Null).
    (c) No Result Posted - If all the records carry Null as result.

    The expression given below, in a text box on the main form, should
be able to get you the desired outcome. "Result" is the name of field
holding the result (0 for failed, other than 0 for passed and Null for
no posting). "T_Test" is the assumed name of table.

    = IIf(DCount("Result","T_Test","Result = 0") > 0, "Failed",
IIf(DCount("Result","T_Test","Not IsNull(Result)") > 0, "Passed", "No
Result Posted"))

    Note - (a) If it is a linked subform, criteria string in the
expression given above should be suitably modified so as to include the
linked child field as well.
                (b) In form's AfterUpdate event for the subform, put the
following statement 
                    Me.Parent.Recalc

Best wishes,
A.D.Tejpal
--------------

  ----- Original Message -----
  From: Nicholson, Karen
  To: Access Developers discussion and problem solving
  Sent: Monday, October 17, 2005 22:25
  Subject: [AccessD] Pass, Fail or Null


  I have a subform that can have an infinite number of records.  On each
line is a result of that record.  If the test has not been performed,
the result is null.  If it has been performed, it can either be a pass
or fail.  If the record has 20 passes and one fail, then the entire
record is a fail.  However, the tests instances are entered in, awaiting
the test to be run, so the test result is null until the values are
filled in.  I am trying to pull an overall result in the main form.  If
all test results are null, or some are null and some are pass, then the
main form value would be null until all tests are run.  
  My brain is not wrapping around this one - the nulls are throwing me.
Ideas?

  Karen S. Nicholson
  Programmer Analyst
  EG&G Technical Services, Inc.
  Pittsburgh, PA
  Phone: 412-386-6649
  Email: cyx5 at cdc.gov
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list