Problem with sum

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

Guest

Problem: I have a query that gives me exactly what I want
as far as a date range, (separate issue); of course it
shows me each record in that date range; I need to somehow
get a grand total for those records and get it on
either/or my main form/subform.
Right now my subform shows all records for specific ID:
 
Problem: I have a query that gives me exactly what I want
as far as a date range, (separate issue); of course it
shows me each record in that date range; I need to somehow
get a grand total for those records and get it on
either/or my main form/subform.
Right now my subform shows all records for specific ID:


You can use an aggregate function in a text box expression.
The text box should be in the header or footer section of
the form you want to total. E.g.

=Sum([amountfield])

Just make sure that use a field name in the form's
RecordSource) for amountfield, not the name of a control on
the form.
 
Thank you Marshall: I am still having trouble, but asked in another
discussion
group this:
Is it possible to assign the value of a report control to a form control
text box?

Marshall Barton said:
Problem: I have a query that gives me exactly what I want
as far as a date range, (separate issue); of course it
shows me each record in that date range; I need to somehow
get a grand total for those records and get it on
either/or my main form/subform.
Right now my subform shows all records for specific ID:


You can use an aggregate function in a text box expression.
The text box should be in the header or footer section of
the form you want to total. E.g.

=Sum([amountfield])

Just make sure that use a field name in the form's
RecordSource) for amountfield, not the name of a control on
the form.
 
dar said:
Thank you Marshall: I am still having trouble,

What kind of trouble???

You didn't perchance put the text box in a page
header/footer did you?

but asked in another discussion group this:
Is it possible to assign the value of a report control to a form control
text box?

Yeah, I saw that and had the same reaction as the person
that responded. But, to answer the question, sure, as long
as the form is open. Just use the standard full reference
to the form control (Forms.theform.thecontrol).
--
Marsh
MVP [MS Access]


Marshall Barton said:
You can use an aggregate function in a text box expression.
The text box should be in the header or footer section of
the form you want to total. E.g.

=Sum([amountfield])

Just make sure that use a field name in the form's
RecordSource) for amountfield, not the name of a control on
the form.
 
Back
Top