Expressions

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

Guest

I'm in the process of creating a database for employee information. I'm
having trouble creating an iif function (if this is what I need to use). For
example: Our company has three shifts and we offer differential in pay for
2nd & 3rd. I need to create a function that once I choose a shift it will
automatically add the differential to the base salary or show me the
percentage that I need to use.
 
Hi Lynn,

Instead of IIF, it would be best to store your differentials in a table
-- that way, they are easier to change in the future.

For instance:

*Shifts*
ShiftID, autonumber -- ie: 1,2,3
Shift, text -- ie: 8am-4pm, 4pm-12am, 12am-8am
DiffPct, number -- percentage for that shift

Then, you can use a combo to identify the shift

Name --> ShiftID
ControlSource --> ShiftID
RowSource -->
SELECT ShiftID, Shift, DiffPct
FROM Shifts
ORDER BY ShiftID
ColumnCount --> 3
ColumnWidths --> .5;1;.5
ListWidth --> 2 'sum of the column widths

Once the Shift is identified, you can referent the differential column
like this:

ShiftID.column(2)

column counts start with 0, so column index 2 is actually column 3

Personally, instead of the differential percent, I would store a
multiplier -- so the first shift would be 1.0, the second 1.2 (if it is
a 20% differential), ...


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

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

Similar Threads


Back
Top