Counting records in report

V

vaa571

I have a field in a Table (Pass/Fail), the data is entered when after a test
result that by a testing program. The result will be either Pass or Fail (if
it has failed the test). I would like to add a count of the number os
failures found and also list the failures seerial#, (there is a field in the
table with the serial #). I am having trouble with the expression, does
anyone has an idea how to make this work? Thanks
Val
 
L

Larry Daugherty

The general rule for posting an issue is "one per thread". If you
haven't visited www.mvps.org/access I suggest that you do for all of
the terrific Access lore there and also "net etiquette". Pay close
attention to the bit about including details.

All of the below is air code so you may have to twiddle and tweak to
get a satisfactory result.

To answer the question in your subject line:

in your report design, put a new text control on the line with the
existing text control that receives the Pass or Fail result. Make the
default value of that new text control something like
IIF(Me!txtPassFail = "Fail", 1,0)
make that text control invisible if you don't want to see it.

Sum the count of that text control in the part of your report where
you report the totals.

----------------------------------------
For your bonus question - there are lots of ways to generate a list of
failed serial numbers. Here's one:

Create a static function named something creative like

ListFailNos(SerialIn as string) as string
ListFailNos = ListFailNos & SerialIN & vbcrlf
end function

You could create a new field in your query and call the above function
on each failure. Something like

ItFailed: =ListFailNos(Serial Number)

Create a text control in the summary section of your report where
you'd like to see the list of failing serial numbers. Bind that
control to ItFailed.

HTH
 

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