Code to calculate employee total cost based on series

tdm32

New member
Local time
Today, 02:02
Joined
Sep 17, 2003
Messages
8
I have a database which contains an employee table (employee ID, name, phone, classification ect.) and I also have a employee expense table ( expense ID, Job Code, Hours, Salary, etc.).
I have a form that contains the employee infor in the form and the employee expenses in the subform.
What I need is too be able to calculate the actual expense the employee is costing the company (including group tax, division taxt etc.) . Based on the info I have, the amount an employee cost the company is based on thier classification (series 1, series 2, etc.).
For example an employee is a series 2 and he made $1500 this week.It would be calculated 1.8 * $1500 =$2700 actual cost.
So what I want, is to be able to input code so that when I input the employee salary, access will lookup the employee series and calculate the actual cost.

Any help is greatly appreciated.
 
tdm,

One approach might be to create a table that holds your classifications and factors and then use a DLOOKUP function to find your factor based on the class entry in your form's textbox. Then multiply the "found factor" by the salary that's -- I presume -- in another textbox on the form.

You can do this with a formula in a control (or two) or by using code that executes during the Current event of your form and during the After Update event of relevant controls.

You will have to add a field in your employee table that matches the primary key in your classification table. (Though perhaps you already have a classification table.)

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom