DSum and RunningSum question

  • Thread starter Thread starter djc
  • Start date Start date
D

djc

1) Whats the difference between Sum and DSum? I read the help file but I am
still not 100% comfortable with it and when to use which?

2) Whats the RunningSum property for reports? How is it different than
putting =Sum(FieldName) as controlSource in a text box on the report?

??
 
djc said:
1) Whats the difference between Sum and DSum? I read the help file but I am
still not 100% comfortable with it and when to use which?

In a form or report text box, Sum operates on a field in the
(possibly filtered) records in the form or report's record
source table/query. Furthermore, in a report, it is
automatically restricted to the level of grouping in which
it is used.

On the other hand, DSum operates directly on a table/query
with an optional, independent filter.

Many times DSum is not practical for use in a form/report
because it can be very messy trying to get DSum to filter
the data the same way the form/report is filtered.

2) Whats the RunningSum property for reports? How is it different than
putting =Sum(FieldName) as controlSource in a text box on the report?

Sum only operates on fields in the report's record source
table/query, it is unaware of the controls in the report.
This means that a text box that has a complicated calculated
value can not not be used with Sum. (If the calculation is
fairly simple, then you could Sum the expression rather than
the text box.) RunningSum is also sometimes used in the
detail section to display a running total.
 
Thanks

Marshall Barton said:
In a form or report text box, Sum operates on a field in the
(possibly filtered) records in the form or report's record
source table/query. Furthermore, in a report, it is
automatically restricted to the level of grouping in which
it is used.

On the other hand, DSum operates directly on a table/query
with an optional, independent filter.

Many times DSum is not practical for use in a form/report
because it can be very messy trying to get DSum to filter
the data the same way the form/report is filtered.



Sum only operates on fields in the report's record source
table/query, it is unaware of the controls in the report.
This means that a text box that has a complicated calculated
value can not not be used with Sum. (If the calculation is
fairly simple, then you could Sum the expression rather than
the text box.) RunningSum is also sometimes used in the
detail section to display a running total.
 
Back
Top