Using multiple bound text boxes

D

DimmickT

I am creating a billing form that runs off of a table. The table has a
lookup field that looks up values in another table. I have the list box in
the form and then several bound text boxes to get the other data in that
table to appear as well ie cost description, price and unit of measure. I
also have a field from another field that pulls the quantity in from another
open form, then I have a text box "Total charges" that multiplies quantity x
unit price to get the total. I would like the calculated info to store in a
field of my table titled "Total Charges". The form works exactly how I want
except when I leave that form to return to the main form the value disappears
and does not store in the table. What am I doing wrong?
 
R

Roger Carlson

Mostly, you don't *want* to store calculations like total charges. What if
some of your charges change? There are exceptions to this, but in most
cases, you should simply recalculate the total charges in a query, form, or
report anytime you need it.


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
D

DimmickT

I do want to store the total charges in this case as it will never change. I
am tracking daily charges for specific transactions and need to produce a
report at the end of the month that not only gives a total but will itemize
and provide detail to the monthly charges. I have the form working to
collect the data but can't get that to store in the field that I want.
 
K

Klatuu

You should not store the value.
Do the same calculation on the report to show the total that you do on the
form.
That is the correct way to do it.
 
D

DimmickT

The data that I am calling total charge is the charge per request form that I
am entering. This amount will never change as it represents that request
form. I need the total per request form so at the end of the month I will be
able to pull the charge by department. The requests are all the same the
only thing that changes is the department, number of pages and the type of
request. The price per page can change based on the time of day the request
was made. Because of all of the variables associated with each of these
entries I need the field that I am calling Total Charge to store in the main
table. I don't see how I can do this calculation on a report since each of
these requests are different. Is there a report function that I am not aware
of?
 
J

John W. Vinson

The data that I am calling total charge is the charge per request form that I
am entering. This amount will never change as it represents that request
form. I need the total per request form so at the end of the month I will be
able to pull the charge by department. The requests are all the same the
only thing that changes is the department, number of pages and the type of
request. The price per page can change based on the time of day the request
was made. Because of all of the variables associated with each of these
entries I need the field that I am calling Total Charge to store in the main
table. I don't see how I can do this calculation on a report since each of
these requests are different. Is there a report function that I am not aware
of?

If you can do the calculation on the Form you can do exactly the same
calculation, in exactly the same way, on the Report.
 
K

Klatuu

If you are saying that the values used in the calculation are not static and
change by time of day and are not stored so they can be used to redo the
calculation, then it would be valid to store the value.

It appears from your original post, you are doing the calculation in the
control source of a text box. If that is how you are doing it, you can't
bind that control to a field in the form's record source. You would then
have to move the calculation to an event - maybe the form's before update
event, and populate a bound control with the results of the calculation.
 
D

DimmickT

I have figured out how to get the form to do what I would like for now.
Thanks for all of your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top