View Full Version : Report Total Error


darreno
03-03-2008, 09:35 AM
I have a table with two columns; [Number] and [Amount]. On the report, I have 3 fields; [Number], [Amount1] & [Amount2].

[Amount1] is =IIf([Number] Like "[A-G]",[Amount],"")
[Amount2] is =IIf([Number] Like "[H-Z]",[Amount],"")

The details are coming up correctly but I am having an error message “Enter Parameter Value” for the total for Amount1 and Amount2.

[Total Amount1] is =Sum([Amount1])
[Total Amount2] is =Sum([Amount2])

The totals are in the Report Footer.

What did I do wrong? Thanks for any advise.

pbaldy
03-03-2008, 09:44 AM
You can't sum a calculated control; you have to repeat the calculation within the Sum().

darreno
03-03-2008, 10:15 AM
I am still having trouble with the following:

=Sum(IIf([Number] Like "[A-G]",[Amount],""))

pbaldy
03-03-2008, 10:18 AM
That should work. Make sure you don't have a control named "number". The wizard creates controls with names the same as fields, but it can screw things like this up.

darreno
03-03-2008, 10:29 AM
I changed the control for number to number1 and have a "Data Type Mismatch in criteria expression."

pbaldy
03-03-2008, 11:12 AM
Can you post a sample db?

darreno
03-03-2008, 12:23 PM
Here is the db.

pbaldy
03-03-2008, 01:29 PM
Sorry, the problem should have dawned on me to start with. Try this:

=Sum(IIf([Number] Like "[A-G]",[Amount],0))

darreno
03-03-2008, 01:54 PM
It's working now. Thank you very much. So, it's the quotation that is causing the problem?

pbaldy
03-03-2008, 02:25 PM
Yes, it was trying to sum a non-numeric value, hence the error. I should have noticed it earlier.