Using count in a sub form

G

Guest

I am using =count([Issued]) to count the number of shares owned by the
shareholder displayed in the main form. Issued is a check mark that
represents checked = yes and unchecked = no. Currently, the count returns the
count of both the checked and unchecked. If I use dcount([Issued]), I can set
criteria, but it count returns all the shareholder not just the one dislayed.
Does anyone know how to count only the checked in the subform.

Thanks
 
R

Roger Carlson

The count function will count any field which has a value. Since both Yes
and No are values, it will count all of them. (Yes is represented as -1 and
No is represented as 0). However, if you use:
=abs(Sum([Issued])),
you should get the correct number. Sum will total all the values, but it
will be a negative number. ABS is the absolute value function which will
convert it to a positive number.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L



um will sum up all the values.
 

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