Control Source Statement Addition

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

RMB gave me the following advice for a previous question I
had. I am now wondering if anyone can help me with
creating another field which would take whatever value the
below statement produces and add it with two other
statements for a field that creates a total charges.

ex.

one field has =IIF([Miles]*[ContractRate]<500,"500"),
[Miles]*[ContractRate]

second field has =[Miles]*[FuelPrice]

third field has =150*[BWFee]

I would like a fourth field which adds all of these
resulting values to create a total charge.

TYIA, the help i've received here in the past has proved
invaluable!!!

Chelle :)


__________________________________________________________
Try this as the Control Source for the field:

=IIF([Miles]*[ContractRate]<500,"500",([Miles]*
[ContractRate]

this simply says that if the total is less than 500, enter
500; otherwise, enter the actual miles times contract rate
 
Hi Michelle,

My name is Dennis Schmidt. Thank you for using the Microsoft Newsgroups.

If I understand you correctly, the following would be how to combine them
together:

=(IIF([Miles]*[ContractRate]<500,"500"),
[Miles]*[ContractRate]) + ([Miles]*[FuelPrice]) + (150*[BWFee])

I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support
 
The quotes should be removed from around the number 500.
=(IIF([Miles]*[ContractRate]<500,500),
[Miles]*[ContractRate]) + ([Miles]*[FuelPrice]) + (150*[BWFee])
 
Hi Michelle,

First try placing each of the equations in the box separately to see if
they return the correct value.

=(IIF([Miles]*[ContractRate]<500,"500"),
[Miles]*[ContractRate])

I think I see an error in this already. Probably should be:

=IIf(([Miles]*[ContractRate])<500,500,([Miles]*[ContractRate]))

Then

=([Miles]*[FuelPrice])

Then

=(150*[BWFee])

If all those work individually, then you should be able to combine them
like below:

=(IIf(([Miles]*[ContractRate])<500,500,([Miles]*[ContractRate])))+([Miles]*[
FuelPrice])+([Miles]*[FuelPrice])

By placing each equation inside parenthesis, it forces Access to compute
each separately before coming up with you sum. Also, don't put quotes
around numbers or you turn them into text and can't use them as part of a
calculation.

I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support
 
Back
Top