Problems with Sum function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am quite a new user to Access and require some assistance.

I have a form with two (2) levels of sub-forms. The main form and the first
level subforms are in Single Form format, while the second level subform is
in Database format.

When I try to Sum the data in the second level sub-form, I dun have a
problem, but when I try to Sum the data in the first level sub-form, it shows
as #Error.

Is it because Access does not allow the Sum function for forms in Form format?

What is the difference between DSum and Sum?

Thks! ;-)
 
jy said:
I have a form with two (2) levels of sub-forms. The main form and the first
level subforms are in Single Form format, while the second level subform is
in Database format.

When I try to Sum the data in the second level sub-form, I dun have a
problem, but when I try to Sum the data in the first level sub-form, it shows
as #Error.

Is it because Access does not allow the Sum function for forms in Form format?

What is the difference between DSum and Sum?


When the Sum function is used in a text box expression, it
operates on a field in the form's dataset (the form's Record
Source table/query). It works for any level and any view of
a form (or report). Normally, it's used in the form's
Header or Footer section. By its very nature, it does not
work in the Page Header or Footer.

I suspect that your problem is that you could be trying to
use it to sum a form control's value instead of a
table/query field. Either that, or that you spelled the name
of the field incorrectly.

On the other hand, DSum is a VBA function that goes directly
to a table or query to sum a field in the entire table,
subject to a filtering expression. While it is generally
slower than Sum, it is usually used for a different purpose.
 
Back
Top