Calculate in Subform

EliteDesk@aol.com

Registered User.
Local time
Today, 13:55
Joined
Sep 11, 2000
Messages
45
I have a sub form,Default View Continuous, with an unbound text box TotalPay control source =[Percentage]/100*Charge but I need to change TotalPay to something like...

If Me.Request.Value = True then
Me.TotalPay = [Percentage]/100*[Charge]
Else
Me.TotalPay = [PercentageReq]/100*[Charge]
End If

Where should the code be placed? Any help would be greatly appreciated!
 
No need for code. You can just change the formula in TotalPay control source to:
Code:
IIF(me.request.value=true, [Percentage]/100*[Charge] ,[PercentageReq]/100*[Charge])

The IIF function works like the IF function in Excel.

hth
Stopher
 

Users who are viewing this thread

Back
Top Bottom