[AccessD] Pass, Fail or Null

A.D.Tejpal adtp at touchtelindia.net
Mon Oct 17 13:47:26 CDT 2005


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



More information about the AccessD mailing list