OK, since my mailbox is 'bombarded' with replies to this post, I'll get back in and give my personal opinion about each (including my own) solution.
AutumnBlues: Your solution implies
coding. From the original question, we cannot detect poster's level of expertise in coding. Trust me, there are people who are able to create and use forms and reports, but they don't even know about the code behind them.
Moreover, Michael was absolutely right in saying your code would be valid for
one record only. That's a fact and you should gracefully admit it.
Besides...why do you want to force the report creator to name the checkboxes in a certain way? Or what if there is a text box name that starts with 'chk'??? There is a ControlType property, you know...
You personally prefer to work with underlying data. That's fine. I personally prefer to have the underlying query to be as simple as possible and provide
only the absolutely necessary data to the form/report. And I'm what you may call a 'calculation extremist'. Whenever I have to choose between including a calculated field in a query and placing a calculated control on the form/report, I choose the latter. I have encountered 'The query is too complex' messages in a few instances and I learnt my lesson. But that's just a matter of personal style (and charm, of course
![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
).
RobPotts and VogonPoet: If the checkboxes are based on expressions, how can you sum them by name (of course I'm speaking of multiple records???) I thought summing the values of calculated controls could be done by entering Sum(EntireCalculationFormulaOfTheControl)...
RobPotts only: I'm sure Michael couldn't stop himself from
![[lol] [lol] [lol]](/data/assets/smilies/lol.gif)
ing after you taught him how to write an expression to sum some values
Dear Me and Myself...The code provided counts only the checkboxes in the detail section, but what if there are more sections in the report? Could that be part of Michael's " moderate revision"? Lucky me it's just moderate...
Michael: Your solution implies coding too. Moreover, the array argument has to be filled in before calling the function. And that has also to be done in coding.
(And if I may say-but you already know it
![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
)You have a really talent in making people cry
Paqguy, where are you?
And finally, whoever gave me that star, thank you
![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)
Daniel Vlas
Systems Consultant
danvlas@yahoo.com