sum of selected records in a subform

N

najimou

Hi

I have a filtered continuous subform based on a query with a
calculated field called "charges" and a checkbox "select"
when the checkbox is checked, i need to have a sum for the checked
records in the footer of the subform.

any ideas how i can perform such an action

thanks in advance
 
A

Allen Browne

Firstly, rename your field in your table, and change the Name and
ControlSource of the check box on your form. SELECT is a reserved word, and
likely to cause you problems.

Assuming you have renamed the yes/no field to IsSelected, you can now place
a text box in the Form Footer section of your continuous subform, and set
its Control Source like this:

=Sum(IIf([IsSelected], [Charges], 0)
 
N

najimou

Firstly, rename your field in your table, and change the Name and
ControlSource of the check box on your form. SELECT is a reserved word, and
likely to cause you problems.

Assuming you have renamed the yes/no field to IsSelected, you can now place
a text box in the Form Footer section of your continuous subform, and set
its Control Source like this:

=Sum(IIf([IsSelected], [Charges], 0)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




I have a filtered continuous subform based on a query with a
calculated field called "charges" and a checkbox "select"
when the checkbox is checked, i need to have a sum for the checked
records in the footer of the subform.
any ideas how i can perform such an action
thanks in advance

Worked Perfectly, and thanks very much for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top