Hi all,
I have what appears to be a simple requirement in an MS Access (2003) report, but I just can't get it to work without it causing problems.
I have a table with data I want to report on, but only on the footer section for the (only) sort item on the table (also declared in the report). I don't want to print the detail section. What I do need to do is accumulate values from the data that is at the detail level. There is only one field there that is important, and that is a one-numeric that can contain the values 0-9. In the footer I want to display the number of each value that was found. E.g. "0" values occurred 4 times, "1" occurred 17 times etc...
I used the report wizard to produce the report, putting the items I wanted on the footer by hand. I then set the detail section visible property to No. That's when things started getting a little harder. Where do I put the code to accumulate counts of the detail level values? It seems that with the visible set to no, the print event code for the section is not called.
I tried setting the fields on the detail section to non-visible, and returning the section as a whole to visible, and putting code in the print event to accumulate the values I need for the footer, and once I set "can shrink" on everything, the output looked good, but then I noticed something very strange - the report looked fine in preview mode, but doubled some of the footer values when physically printed! I had even put the code inside an IF check for PrintCount=1 in case it was calling the detail section print event more than once, but it made no difference.
Now I'm sure that this is a reasonably common thing to want to do - not show detail level data, while making use of values that are stored at the detail level, but I have no idea what the "correct" solution is. Can anyone point me in the right direction?
Thanks.
I have what appears to be a simple requirement in an MS Access (2003) report, but I just can't get it to work without it causing problems.
I have a table with data I want to report on, but only on the footer section for the (only) sort item on the table (also declared in the report). I don't want to print the detail section. What I do need to do is accumulate values from the data that is at the detail level. There is only one field there that is important, and that is a one-numeric that can contain the values 0-9. In the footer I want to display the number of each value that was found. E.g. "0" values occurred 4 times, "1" occurred 17 times etc...
I used the report wizard to produce the report, putting the items I wanted on the footer by hand. I then set the detail section visible property to No. That's when things started getting a little harder. Where do I put the code to accumulate counts of the detail level values? It seems that with the visible set to no, the print event code for the section is not called.
I tried setting the fields on the detail section to non-visible, and returning the section as a whole to visible, and putting code in the print event to accumulate the values I need for the footer, and once I set "can shrink" on everything, the output looked good, but then I noticed something very strange - the report looked fine in preview mode, but doubled some of the footer values when physically printed! I had even put the code inside an IF check for PrintCount=1 in case it was calling the detail section print event more than once, but it made no difference.
Now I'm sure that this is a reasonably common thing to want to do - not show detail level data, while making use of values that are stored at the detail level, but I have no idea what the "correct" solution is. Can anyone point me in the right direction?
Thanks.
Comment