Control Source

A

AccessDummy

I have a form with a number of text boxes. One particular text box,TOtal
, is calculated from the figures of the data in other text boxes, i.e
TOTAL = QUANTITY*COST.

So I have an expression in the control source for the TOTAL text box.
The expression get calculated and gets shown on the form but does not
get put into database

anyone know why this happen?
 
R

Rick Brandt

AccessDummy said:
I have a form with a number of text boxes. One particular text box,TOtal
, is calculated from the figures of the data in other text boxes, i.e
TOTAL = QUANTITY*COST.

So I have an expression in the control source for the TOTAL text box.
The expression get calculated and gets shown on the form but does not
get put into database

anyone know why this happen?

Controls on forms can either be bound to fields in the underlying RecordSet
or contain expressions. They cannot do both at the same time. The good
news is you shouldn't be trying to store the calculation anyway. It's a
waste of disk space and bad database design.

Just delete the field from the table and congratulate yourself for doing it
right. If you need this calculation in many places throughout your app,
then create a query based on your table and add the calculation as a
calculated field in the query. Then you just substitute the query for the
table every place you need the Total.
 

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