DCounting Non-Blank cells

acarterczyz

Registered User.
Local time
Yesterday, 18:00
Joined
Apr 11, 2013
Messages
68
Hey guys. I think I read somewhere that DCount will not count blank cells, but when I try to do it - it counts everything.

Here is my formula:
=DCount("[E-Mail]","Detail","Not IsNull([E-Mail])" & " AND [Primary] = [Products]![Product Code]")

Basically, I want to count the number of email addresses in the E-Mail column of my Detail table IF the Primary column (also in the Detail table) equals the product code on my form AND if there is something in the E-Mail column for that line. When I did the above formula - and I've done a bunch of different variations - it keeps counting all lines that match the product code. :banghead:

What am I doing wrong?
 
You assume that a "blank" cell Is Null.
 
Is it not? I'm not sure how else to tell a DCount formula to not include blank cells.


Edit: I'm still somewhat a newbie.
 
I was playing around with it and got it to work!

=DCount("[E-Mail]","Detail","[E-Mail] Not In (Null, '')" & " AND [Primary] = [Products]![Product Code]")
 

Users who are viewing this thread

Back
Top Bottom