View Single Post
  #2  
Old April 26th, 2008, 11:47 PM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default Count - if statement....

Learning_codes,

The syntax of the one that works and the one that doesn't are different.

Also, the use of the "Like" keyword here is not necessary, apparently,
as you have no wildcard.

Therefore, try:
="Completed: " & Sum(IIf([GroupA]="1",1,0)) & " of " & Count (*)

If I have misunderstood, perhaps you can give some more details of where
these textboxes are located, and what is the meaning of the fields such
as Answer and GroupA and GroupB and what is the relationship between them.

--
Steve Schapel, Microsoft Access MVP

wrote:
Hi,

I created a box called TXT_Completed for me to put ="Completed: " &
Sum(IIf([Answer] like "1",1,0)) & " of " & Count (*)
and it works.

I have four groups and I want to set like below and I'm not able to
make it work.

="Completed: IIf([GroupA] like "1",1,0)) & " of " & Count (*)
and
next one,

="Completed: IIf([GroupB] like "1",1,0)) & " of " & Count (*)

I'm struggling last two A and B. Your help would be much
appreciated. I don't know if I do the right thing.

Thanks