Hi folks,
I've got another (inherited) puzzle that I don't understand.
A report that I need to modify contains a subreport that lists a variable number of items in its detail section and then has a footer which contains a count of those items. That is, the "detail" section of the main report consists of a page for each sub-category listing the items in that category and then includes a count of the items for that sub-category.
The way whoever (i.e., whichever of the half-dozen people it was) did that was to include with each detail item, an invisible textbox field (named COUNT with a "Control source" of "=1".
The puzzling part of this is that when I made the textbox visible, I found that the value in the boxes increased, so that rather than simply having a value of "1" in each line, the successive COUNT boxes were, indeed, a count. My anonymous predecessor then inserted the count into the footer as "=Sum([Count])/15" which, for reasons I fail to appreciate, actually appeared to work.
Unfortunately, I have to say "appeared to work" rather than "worked" because although it gave the correct total most of the time it occasionally geve the wrong total. I'm not sure why that is the case -- possibly a rounding error, but some of the totals are wrong. Frankly, I'm not even sure why most of them are right. What dividing by 15 should have to do with it makes no sense to me.
Anyway, my first real question is why "=1" as the control source for a textbox results in anything other than "1".
My next question is how to extract a useful value from the boxes. I have tried "=Max(Count )" but what I found is that the successive instances of this subreport all give the same total, whether or not that is the correct number for that page, e.g. all of them show "14" whether the real count for that page should be 14, 3, 22, or whatever. Using "=Last(COUN T)" does exactly the same, giving the same weird number that is the same for all of the pages. Using "=COUNT" is almost the same in that almost all of the pages get the same number as each other (10, which is not 14 and so is different from Max or Last), but a few pages get a different number (20). What I want to do is either to pull the last value of COUNT into the total box or else make all of the boxes have a value of "1" and then use "=Sum(COUNT )".
Any clues about what is going on, and/or what I am doing wrong would be gratefully appreciated.
Thanks,
Paul
I've got another (inherited) puzzle that I don't understand.
A report that I need to modify contains a subreport that lists a variable number of items in its detail section and then has a footer which contains a count of those items. That is, the "detail" section of the main report consists of a page for each sub-category listing the items in that category and then includes a count of the items for that sub-category.
The way whoever (i.e., whichever of the half-dozen people it was) did that was to include with each detail item, an invisible textbox field (named COUNT with a "Control source" of "=1".
The puzzling part of this is that when I made the textbox visible, I found that the value in the boxes increased, so that rather than simply having a value of "1" in each line, the successive COUNT boxes were, indeed, a count. My anonymous predecessor then inserted the count into the footer as "=Sum([Count])/15" which, for reasons I fail to appreciate, actually appeared to work.
Unfortunately, I have to say "appeared to work" rather than "worked" because although it gave the correct total most of the time it occasionally geve the wrong total. I'm not sure why that is the case -- possibly a rounding error, but some of the totals are wrong. Frankly, I'm not even sure why most of them are right. What dividing by 15 should have to do with it makes no sense to me.
Anyway, my first real question is why "=1" as the control source for a textbox results in anything other than "1".
My next question is how to extract a useful value from the boxes. I have tried "=Max(Count )" but what I found is that the successive instances of this subreport all give the same total, whether or not that is the correct number for that page, e.g. all of them show "14" whether the real count for that page should be 14, 3, 22, or whatever. Using "=Last(COUN T)" does exactly the same, giving the same weird number that is the same for all of the pages. Using "=COUNT" is almost the same in that almost all of the pages get the same number as each other (10, which is not 14 and so is different from Max or Last), but a few pages get a different number (20). What I want to do is either to pull the last value of COUNT into the total box or else make all of the boxes have a value of "1" and then use "=Sum(COUNT )".
Any clues about what is going on, and/or what I am doing wrong would be gratefully appreciated.
Thanks,
Paul
Comment