Double Click To Calculate

  • Thread starter Thread starter serviceenvoy
  • Start date Start date
S

serviceenvoy

I have a field where I sometimes need to manually enter an amount but
sometimes I need it to calculate an amount based on 2 other fields. I
know this is not normalized data but this is how we need to run this
particular field.

I would like to setup the field to allow me to manually enter data
most of the time, but then calculate when I double click. The
calculation would be [totalpartsCost]/0.8. I just don't know how to
create the code it in the event procedure.
 
In the double click event of the textbox, add the code:
me.[yourtextboxname]= [totalpartsCost]/0.8
This assumes totalpartscost is a text field on your form.
to check for nulls, you might amend the above to:
me.[yourtextboxname]= nz([totalpartsCost]/.8,0)

Damon
 
Back
Top