Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum of a field

Status
Not open for further replies.

buddyel

MIS
Mar 3, 2002
279
US

I have a form based on a query that prompts for a particular part number. what I would like the value of a textbox (txtYTDCO1) to equal the sum of all values in the QTY field for that particular part number. Can anyone help?

 
Does the form contain other detail level fields or just summary info? J. Jones
jjones@cybrtyme.com
 

The form consists of two labels, and 4 textboxes. The query that the form is set to uses all the fields from the table.
 

The form consists of two labels, and 4 textboxes. The query that the form is set to uses all the fields from the table.
 

The form consists of two labels, and 4 textboxes. The query that the form is set to uses all the fields from the table.
 
To use the sum function, you'll have to be summing a field (not a control on the form). You could include the field to be summed in the detail section of the form. (even if you need to hide it that's okay). Then, include an unbound field in the footer section that uses a Control source of:

=sum(fielda)

where fielda is your fieldname


Or, you could do the calculation in the query...

J. Jones
jjones@cybrtyme.com
 

How would I do the calculation in the query so that it sums the QTY field for all records returned in the query.
 

How would I do the calculation in the query so that it sums the QTY field for all records returned in the query.
 
You could not do it in the same query, but you would do it in a separate group (or aggregate) query. J. Jones
jjones@cybrtyme.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top