Iif statement

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.
 
G

George Nicholson

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top