Quote:
Originally Posted by ConfusedMay
Can someone help me on this please....
Hi. There is no easy way to do this within your report, as Access is not to know that in fact the invoice amount may be a repeated value which should not be counted more than once. It is possible to use VB within the detail section to increment or decrement unbound values, but I wouldn't recommend this approach.
There is a work-around at the query level which will resolve this for you. Create a Count query counting the number of invoice rows for each invoice number based on your report's recordsource query:
- SELECT [queryname].[invoice number], Count([invoice number] as N from [queryname] GROUP BY [invoice number];
Save this under a suitable name. Create another new query in which you join the new Count query to the original report query on the invoice number. Include all the fields from your original report query along with the count field, N, from the count query. Save this under a suitable name, then change the report's recordsource from your original query to this new one.
In your report add the new count field N to the detail line somewhere, but set its visible property to false (unless you want to show how many invoice payments there are for that invoice). Finally, to get the true invoice value shown on each unbound invoice total change the control source to
-Stewart