Countif or dcount???

G

Graham Feeley

Hi need some help here please
Table Name = AllRunners
Field = p1
Field = res1st

I would like a textbox to reflect the count of all records where P1 = res1st
both fields are integers

I do not know if the textbox goes in the Form Footer or a SubForm.
Also not sure which to use "DCount" , "Countif" , "Countiff"

Hope this is clear enough
Regards
Graham
 
G

Graham Feeley

Thanks Duane this works perfectly .....as u would know it would, and I
appreciate your help on this
Regards
Graham
 
F

fredg

Hi need some help here please
Table Name = AllRunners
Field = p1
Field = res1st

I would like a textbox to reflect the count of all records where P1 = res1st
both fields are integers

I do not know if the textbox goes in the Form Footer or a SubForm.
Also not sure which to use "DCount" , "Countif" , "Countiff"

Hope this is clear enough
Regards
Graham

There are no CountIf or CountIIf functions in Access.
DCount will count all instances in the Table where the criteria is
met, which may or not be the same as what is in the form's record
source.

You can sum the instances where the criteria is met (True or -1).
ABS() returns the positive value.

In the form header (or footer)
=ABS(Sum([P1]=[res1st]))
 
Top