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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I add 3 fields in a form?

Status
Not open for further replies.

jimrawr

MIS
Oct 8, 2005
16
US
Hey everyone, I am really new to access and im trying to do something that is probably fairly simple for you guys..

I have a form setup, and I need one of the fields to simple add up 3 other fields. I.E fixed expenses + variable expenses + misc expenses = total expenses..

How do I do this? I figure out how to do it in a query by doing totalexpenses: [field1]+[field2]+[field3]

but how do I do it in a form?

Thanks in advance
 
How are ya jimrawr . . .

Set the [blue]ControlSource[/blue] property of an [blue]unbound Textbox[/blue] to:
Code:
[blue] =[field1]+[field2]+[field3][/blue]

Calvin.gif
See Ya! . . . . . .
 
Another thing... is it possible to do it just in the table? where would I put in the code for the field?
 
No. You cant do math in a table. Think carefully about whether you want to anyway. One major goal of a relational database is to eliminate the storage of redundant info. Why store data that can be gleaned from other data? You may need to display it, but do you need to store it?
 
Popular wisdom states that you never store calculated data in a table, but as Lilliabeth notes, you need to think about this. If all factors in the calculation will remain the same (such as POUNDS X 16 = OUNCES)then they shouldn't be stored in the table. If any factor could change in the future,however, such as the price per pound (POUNDS X $1.59 becomes POUNDS X $1.89) then the calculated price needs to be entered in the table.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top