saving a text box

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have a patient survey that assigns a numeric value to
each question at the end of the survey I created a text
box that calculates the sum of numeric value from each
field. How can I save the sum into the field of a table.
 
Mike,
Since the field on your form has a calculation as it's RecordSource, it's
not "bound" to any field in your table.
This is an often posted question...
"How do I save the results of a calculated field (on my form) to my table?"

First, in most instances, you don't "save" calculations in a table. If,
for example,
you had Price and Qty, you wouldn't have to save the LineTotal (Price*Qty =
LineTotal).
Since you've captured Price and Qty in your table, you can always
"re-derive" the LineTotal... "on the fly" in any subsequent
form/query/report/ etc.. using a calculated "unbound" field on the form, for
display purposes only...
= Price * Qty

You don't indicate what fields go into your calculation, so let's use my
example above, and you apply it to your field/table/form names etc...

If you MUST capture the calculation, remove the calculation in the
ControlSource of LineTotal, and "bind" the control to the LineTotal field
in your table, and
on the AfterUpdate event for Price AND Qty...
LineTotal = Price * Qty
That way, if you enter (or change) either Price or Qty your LineTotal
field will be updated and "captured"... since LineTotal is "bound" to the
LineTotal field in your table.
-
HTH...
Al Campagna
Candia Computer Consulting
Candia, NH
 
Back
Top