sum of selected records in a subform

  • Follow


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

0
Reply najimou 4/29/2007 2:15:00 PM

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.

"najimou" <ijandaroum@hotmail.com> wrote in message
news:1177856100.617219.7010@u30g2000hsc.googlegroups.com...
>
> 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 

0
Reply Allen 4/29/2007 3:30:31 PM


On Apr 30, 1:30 am, "Allen Browne" <AllenBro...@SeeSig.Invalid> wrote:
> 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.
>
> "najimou" <ijandar...@hotmail.com> wrote in message
>
> news:1177856100.617219.7010@u30g2000hsc.googlegroups.com...
>
>
>
> > 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


0
Reply najimou 4/30/2007 4:27:05 AM

2 Replies
1076 Views

(page loaded in 0.095 seconds)


Reply: