Iif statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Iif statement in a textbox control on my form that runs a
calculation for estimated yearly earnings.
=IIf([txtPayType]="Salary",[txtPayRate]*12,[txtPayRate]*2080)
[txtPayType] is either Salary or Hourly. Salary is multiplied by 12, Hourly
by 2080 to get the estimated yearly pay. I need to add something in the
statement to account for Full Time or Part Time employees. The code as is
calculates for Full Time. I have a field linked to the control [txtEmpStatus]
where i select either Full Time or Part Time. If an employee is Part Time and
Hourly it needs to be multiplied by 1248. All Salaried employees are Full
Time.
 
As I understand it there are 3 possibilites: Full Time Salary, Full Time
hourly, and Part Time Hourly. The following handles them in that order:

=IIf([txtPayType]="Salary",[txtPayRate]*12,iif([txtEmpStatus] = "Full Time",
[txtPayRate]*2080, [txtPayRate]*1248))

HTH,
 
Back
Top