calcuated form field based on two other form controls

  • Thread starter Thread starter Spence
  • Start date Start date
S

Spence

I have a billing form based on tblInvoice with a subform
based on tblInvoiceDetail. I need to create a calculated
field in the subform based on two variables:

1. The value in a CustomerType option group in the main
form.

2. The ServiceType chosen (from a lookup table) in the
line item of the subform.

Basically, if CustomerType=1, the subform calculated field
will be simply [Rate]*[Units], but if the CustomerType=2,
the field will be ([Rate]*[Units]*1.1155. However, in the
case of one of our ServiceType codes, "731," the equation
is [Rate]*[Units] regardless of the type of customer. So
what I'm trying to create is something that says

If CustomerType= 1, [Rate]*[Units]
If CustomerType= 2, [Rate]*[Units]*1.1155
If type of service=731, [Rate]*[Units] (regardless of the
value of customer type.)

Can someone help me out with the sytax here? I tried a few
things but I can't get it right. Hope my explanation is
clear.

Thanks,
Spence
 
Spence,
I tried this out... it should work.
=IIf([TypeOfService]=731 Or
[CustomerType]=2,[Units]*[Rate],[Units]*[Rate]*1.1155)
 
Al,

You rock. I've been struggling with this all day.

thanks,
spence

Going on this assu
-----Original Message-----
Spence,
I tried this out... it should work.
=IIf([TypeOfService]=731 Or
[CustomerType]=2,[Units]*[Rate],[Units]*[Rate]*1.1155)

--
HTH...
Al Campagna
Candia Computer Consulting
Candia, NH


If CustomerType= 1, [Rate]*[Units]
If CustomerType= 2, [Rate]*[Units]*1.1155
If type of service=731, [Rate]*[Units] (regardless of the
value of customer type.)

Can someone help me out with the sytax here? I tried a few
things but I can't get it right. Hope my explanation is
clear.

Thanks,
Spence


.
 
Back
Top