The Sum command gives an error

S

Sarai

Basically, if I create a text box and write the name of the control (
=(Janeiro) ) the information shows up; but when I add Sum to the control it
gives the message =Error.

I have the exact same expression in another form and it does not give any
problem.

Details: I created a Crosstab query last year to see the sum of values for
several categories throughout the year, adding a total for each category for
the annual column. Then I created a form to visualise the data and added text
boxes to give me the sum of all the categories for each month. I just wrote
=Sum([Janeiro]) and so on for each month, plus the annual column. No problem,
everything comes out fine.

This year I did another crosstab query, for this year values, and then
copied the last year form because I wanted the same exact aspect without
having to go through the hassle of re-creating it, and then changed the
control to the new query. I've done this with other forms without problems.

The form shows all the data correctly to the exception of the text boxes I
had added to sum the values for each month, which gives the problem I
described at the beginning.

Please explain to me what's wrong because I've been through several places
that mention errors involving the sum command and they haven't fixed my
problem.

Thank you for your help
 
G

golfinray

Are you trying to sum text? Is Janeiro some numbers? If so you should be able
to do =sum([janeiro]) If not, you could use other functions like max, min,
first, last, but I don't think sum works with text.
 
S

Sarai

Hello, golfinray. And thank you for answering me.

Janeiro is the name of the control. The actual data are numbers; namely, the
amount of money spent during that month, duly divided into their categories
and which I'd like to see sum up.
 

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