Sum of a field from Crosstab Query

D

DZ

Hi

I have a form whose record source is a Crosstable query.

Several columns of data in the form (and underlying CrossTab Query ) are
numeric and in the form footer I have text box, txtTotal, with
"= Sum([txtNumericCol1])" as the control source.

txtNumericCol1 is a text box in the Detail section whose ControlSource is a
numeric field from the underlying CrossTab Query.

txtTotal displays #Error.

But...If I set txtTotal control source to simply "= [txtNumericCol1]", then
txtTotal displays the correct value from the current record.

I want txtTotal to display the total but I'm getting an error.

I tried using DomaineAggregate functions and I am able to get the totals
that way but there is alot of data and they are extremely low (They take 15
to 20 second to display the total)

Thanks
I will credit any helpful responses
 
G

Graham Mandeno

Hi DZ

Instead of using the control name (txtNumericCol1) in the Sum expression,
use the actual field name that is the ControlSource of txtNumericCol1.
 
D

DZ

Yws. That worked ! Great

I always thought that you were supposed to refer to controls when doing
calculations from text boxes on forms and reports ???

Any enlightenment on this would be appreciated
 

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