Setup logic in form field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a question which is probably very simple to any expert.
On a form, how do I setup the following logic: Field3=Field2/Field1?

I tried the expression builder "afterchange" and added the logic just
mentioned. Though I have no error messages I also don't see the result.

Any help will be very appreciated.
Thanks,
Kanga
 
See:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

The article explains how to use a calculated field in a query instead of
storing the value in a table where you can get it wrong. It then explains
how and when to store it if you want to do that anyway.
 
To add to Alan's Example, you can write on the ControlSource Property of
field 3
=[Field2]/[Field1]

Now if Field1 will have 0 value you might get an error that you cant have
devision on 0, and you will get an error meaage if any of the fields will be
null

so, you should write
=IIF(nz(Field1],0)=0,0,nz([Field2],0)/[Field1])
 
Back
Top