Report sum problem

V

Veli Izzet

Hi,

I have a control (Text33)which has the value

=IIf(Forms!frmCariler!Cari=[Alacakli];-[HareketTutar];[HareketTutar])

I cannot sum this with =sum([Text33]). The report thinks Text33 is a
parameter and asks for it when run.

Thanks for answers
 
A

Allen Browne

That's correct. You can't sum a calculated field.

Try repeating the entire expression, i.e.:
=Sum(IIf(Forms!frmCariler!Cari=[Alacakli];-[HareketTutar];[HareketTutar]))
 
V

Veli Izzet

Allen thanks,

But a very funny thing, the report was based on a query sorted on date &
time. With the summing expression the report is not sorted at all. I
remove the summing expression, and voila, no problem.

What is going on???
 
A

Allen Browne

The sorting in a report is defined by its Sorting and Grouping box (View
menu).

If you don't enter anything there, the sort order is undefined, i.e. it may
(or may not) follow the order specified in its source query, depending on
what other complexities are in the report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Veli Izzet said:
Allen thanks,

But a very funny thing, the report was based on a query sorted on date &
time. With the summing expression the report is not sorted at all. I
remove the summing expression, and voila, no problem.

What is going on???



Allen said:
That's correct. You can't sum a calculated field.

Try repeating the entire expression, i.e.:

=Sum(IIf(Forms!frmCariler!Cari=[Alacakli];-[HareketTutar];[HareketTutar]))
 
L

Larry Linson

so there is no need to use a
query just for sorting..

Correct: the sort order in the Query used as Record Source is immaterial. It
is the Sorting and Grouping that determines the Report's Sort Order.

If you have none specified in the Report's Sorting and Grouping, as Allen
said, you may see the Records in the same order as in the Query, or you may
not, but you certainly cannot rely on them appearing in any particular
order.

Larry Linson
Microsoft Access MVP
 

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