update form on change of field used in expression

M

mtggal

I have one form based on a table, which calculates the unit costs based on
the total price and number of units received. I created this form some time
ago, and it works perfectly. The moment I change the total cost or units, it
updates the unit price field accordingly.

I created a similar form, also using an expression that determines the
profit if sold at a price (the 'sold at' field). However this form does not
change the calculated field until I F5 or refresh. I cannot see what I did
differently in the original form, however would like this new form to update
immediately when I change one of the fields the expression is based on.

Example of expression would be: =[Sold_at]-[UnitCost]

Thanks in advance for the help.
 
J

Jeanette Cunningham

First, I would put the code on the after update event of both Sold_at and
UnitCost.
When user updates either Sold_at or UnitCost, the calculated control should
show the new profit.

Note that your post gives us very little information to use in trying to
work out why it's not working.
Is this how you have set up the code?


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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