Sure,
Well, you see, I create a lot of different Access databases for different clients, so I have been in the mind set to make any functions and code I develop to be as easily resuable between projects as possible.
One of the things I've developed is a flexible reporting system. There is a table to hold the reports info: Display Title, report name, and other stuff, along with 10 fields for the names of "criteria forms." each of these forms is developed based on a template, but each one can be created to pull data from tables or calculate values. Each of the forms is for choosing a single bit of criteria - I have one for date range, ones created for individual database items - choosing a person, or a category of some sort, etc. And one is for chossing whether to show Details and/or Summary information on a report. (Two check boxes)
The way the system works is that the forms (using the ReportID) can string themselves together like a wizard, and to add a new report to my menu, I just need to add the report info to my reports table. And to each of the criteria fields, if there is a need for criteria, I put the name of the criteria form in.
Anyway, the detail/summary criteria form's code needed to be flexible enough to take various arguments to show/hide various sections of the report, and I found that certain fields needed to be hidden, if for instance, the detail records weren't going to be displayed, even though those fields were in a section that should remain displayed (because it had a header). So, The problem I was facing is that just hiding a field doesn't close up the empty vertical space - you actually need to change the height of the section to tighten it up. So, the correct section height had to be calculated minus the field that had been hidden, and the way I was finding the controls that need to be hidden for a "Summary only" report was by putting certain text in the "TAG" property of those controls on the report, then having the code loop through the controls in each section to hide certain ones and subtract the height of the hidden control from the height of the section, and set the new height.
Phew...
Anyway, the reason i wanted to get the number of sections was so that when I loop through the sections on the page, I know when to stop.
If people are very interested I might be able to upload a stripped down version of this one report I was working on so it might make more sense...
Thanks, I have learned a lot in these forums!
Heather
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
Floyd Innovations
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)