Connecting Tech Pros Worldwide Forums | Help | Site Map

continuous form, how to sum unbound control in footer ?

Roger
Guest
 
Posts: n/a
#1: Nov 13 '05
I've got a continuous form based on a query
the first 2 controls on the form are bound to columns in the query
a third control (paymentAmount) is unbound
I have a total control in the footer, where the control source is
=sum(paymentAmount)


this displays #Error#

but if I temporarily change my query to add a paymentAmount column
with a value of 1, and I change the control source of the
paymentAmount control to 'paymentAmount', (so the control is called
paymentAmt and the control source is paymentAmt), my total control in
the footer displays the correct total

now if I change the name of the control to paymentAmount2, with a
control source of paymentAmount, the total control is correct

if I change the control source of the total control to

=sum(paymentAmount2)

my error returns....

why does it sum only a control source ?
how do I get to sum the contents of a control ?

Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: continuous form, how to sum unbound control in footer ?


As you found, you can only sum field(s) that are in the form's RecordSource.

Having the calculated field in the query is a good solution.

The alternative is to repeat the actual fields in the Control Source, e.g.:
=Sum([Credit] - [Debit])

--
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.

"Roger" <lesperancer@natpro.com> wrote in message
news:8c7a509f.0409222003.505801b8@posting.google.c om...[color=blue]
> I've got a continuous form based on a query
> the first 2 controls on the form are bound to columns in the query
> a third control (paymentAmount) is unbound
> I have a total control in the footer, where the control source is
> =sum(paymentAmount)
>
>
> this displays #Error#
>
> but if I temporarily change my query to add a paymentAmount column
> with a value of 1, and I change the control source of the
> paymentAmount control to 'paymentAmount', (so the control is called
> paymentAmt and the control source is paymentAmt), my total control in
> the footer displays the correct total
>
> now if I change the name of the control to paymentAmount2, with a
> control source of paymentAmount, the total control is correct
>
> if I change the control source of the total control to
>
> =sum(paymentAmount2)
>
> my error returns....
>
> why does it sum only a control source ?
> how do I get to sum the contents of a control ?[/color]


Closed Thread