Each text box on a form is bound to a single field OR it's unbound OR
it's a temporary calculation. You can easily tell the difference in
design view:
- For a textbox bound to a single field, it will show ONLY that single
field's name in design view.
- For an unbound textbox, it will actually say "Unbound" when in
design view.
- For a textbox performing a calculation, it will be preceded with the
equals sign.
The last two types do not save to your table and are 'lost' when you
close the form. Alternatively, editting the first type (a regular
bound text box) actually edits the table.
If you HAVE to save that field, you'll have to turn your "Profit/Loss"
textbox into a text box bound to "[Profit/Loss]", and use visual basic
to run the calculation in code whenever [total income] or [total
expenses] are updated. Don't forget to set the text box's "Locked"
value to true.
HOWEVER, any experienced access user will tell you not to save a
calculated field like that permanently if you don't have to.
You are far better off NOT having a field for "Profit/Loss" in your
table at all. If you need to see that field calculated in a table-
style view, you need to write a query. A query is a temporary table
view (with calculations) that draws from a table... you get to pick
what fields it takes from any table.
Best of luck,
~J
I have a simple calculation on a form in a field called Profit/Loss which
reads =[total income]-[total expenses] it calculates fine and I see it on the
form. When I switch to the table each cell in the column for Profit/Loss is
blank why?