Best way to obtain sales total into text box

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

Guest

Can it best be done with a totals query which contains a criteria reference
to the form's customer number.
If so then how do I tie the result (one figure) to the control's source.
 
Can it best be done with a totals query which contains a criteria reference
to the form's customer number.
If so then how do I tie the result (one figure) to the control's source.

Are you trying to store this total into a table field?

If so... DON'T.

Just calculate it on the fly instead. You can use a Totals query; set
the control source of a textbox to =DSum("[amount]", "[tablename]",
"[CustomerID] = " & [CustomerID]); or put a textbox in the form or
subform Footer with a control source =Sum([amount]). There are very,
very few circumstances where you would want to store this derived
value!

John W. Vinson[MVP]
 
Thanks for the solution. DSUM, wow yet another function, love it.

No i don't need to store, just display.

--
Regards
Tom


John Vinson said:
Can it best be done with a totals query which contains a criteria reference
to the form's customer number.
If so then how do I tie the result (one figure) to the control's source.

Are you trying to store this total into a table field?

If so... DON'T.

Just calculate it on the fly instead. You can use a Totals query; set
the control source of a textbox to =DSum("[amount]", "[tablename]",
"[CustomerID] = " & [CustomerID]); or put a textbox in the form or
subform Footer with a control source =Sum([amount]). There are very,
very few circumstances where you would want to store this derived
value!

John W. Vinson[MVP]
 
Back
Top