I have a form called "HMLogMain" with the following fields [Account], [AccountName], [DateShred] and [ReasonToShred] that reside in the detail section. I also have a subform called "SubMenuShred" which captures the listing of the documents to be shredded with the following fields [DescOfDoc], [NoPages].
I wanted to run a report by date range so I created a query called "ShredListingQuery" and I joined "HMLogMain" and "SubMenuShred" using both tables using the field "ID" autonumber and named the query "ShredListingQuery".
The report points to the record source is "ShredListingQuery". I want to be able to get count for of each account with [ReasonToShred]. I do not want to count all the records in the subform. So for instance if I entered 6 documents for a particular account I want the count to be "1" and not "6".
I thought the function "DCount" would give the result but so far it gives me the same total as the function "Count". :banghead: Any help would be appreciated. Below I have the two examples I have tried thus far.
=Count(IIf([REASONTOSHRED]="Hold for more than 2 years",0))
=DCount("[Account]","ShredListingQuery","[REASONTOSHRED]= 'Hold for more than 2 years'")
I wanted to run a report by date range so I created a query called "ShredListingQuery" and I joined "HMLogMain" and "SubMenuShred" using both tables using the field "ID" autonumber and named the query "ShredListingQuery".
The report points to the record source is "ShredListingQuery". I want to be able to get count for of each account with [ReasonToShred]. I do not want to count all the records in the subform. So for instance if I entered 6 documents for a particular account I want the count to be "1" and not "6".
I thought the function "DCount" would give the result but so far it gives me the same total as the function "Count". :banghead: Any help would be appreciated. Below I have the two examples I have tried thus far.
=Count(IIf([REASONTOSHRED]="Hold for more than 2 years",0))
=DCount("[Account]","ShredListingQuery","[REASONTOSHRED]= 'Hold for more than 2 years'")