Calculation if Statement (1 Viewer)

sandylt

Registered User.
Local time
Yesterday, 22:37
Joined
Mar 11, 2004
Messages
36
I have a form for evaluating our cleaning service. If the services total score is below 90% then it only gets that percentage of payment. If it is any where in the 90% range then they get full price. Is there any way to write an if statement saying If <90% then ContPrice * Percent, If >= 90% Normal.
 

R6Flyer

Yamaha hooligan
Local time
Today, 04:37
Joined
Nov 21, 2003
Messages
95
Firstly you should not be storing this calculation in your table as it can be created on the fly in a query and output to your report.

The only values that you need to store are [TotalScore] and [ContPrice] where TotalScore is numeric type (single) and ContPrice is set to currency. TotalScore will be a value between 0 and 1 as it should be the percentage returned by your service evaluation.

In your query you will need a calculated field such as:

Code:
FinalPrice: IIf([TotalScore]<0.9,[ContPrice]*[TotalScore],[ContPrice])

This will calculate the final price dependent on the total score percentage and you can include this figure in your reports.
 

sandylt

Registered User.
Local time
Yesterday, 22:37
Joined
Mar 11, 2004
Messages
36
Im not storing it in a table it on my form. The Scores are calculated on the form. Do I add this statement to the control source? I tried it and it gave me an error.
 

jfgambit

Kinetic Card Dealer
Local time
Today, 04:37
Joined
Jul 18, 2002
Messages
798
You should be storing this in an unbound textbox on your form. Is that where you put it? If so, what was the error you received?
 

sandylt

Registered User.
Local time
Yesterday, 22:37
Joined
Mar 11, 2004
Messages
36
It is in an unbound text box. The text box read #Error.
 

jfgambit

Kinetic Card Dealer
Local time
Today, 04:37
Joined
Jul 18, 2002
Messages
798
Did you change the names in the above example to be thise in your database?

Can you post a sample of your Db so we can look at it?
 
R

Rich

Guest
should be
=IIf([TotalScore]<0.9,[ContPrice]*[TotalScore],[ContPrice])
 

Users who are viewing this thread

Top Bottom