Calculate Weekly Payroll Hours
Posted on 2003-11-21
I have a payroll form with employees & their time in(emp1ti) & time out(emp1to) that is filled out daily. I have an expression to calculate an employee's daily hours minus 1/2 hour for lunch in the control source property of a box used just for display: =(DateDiff("n",[emp1ti],[emp1to])/60)-0.5
I need to also display total weekly hours on the form. I have a table field (emp1twh) that I would like to write the daily time as an integer to. I would like to add to that field every day's daily hours until it is Monday again, then overwrite the field. The new value should be displayed as soon as the new timein and timeout are entered. I have the following psuedo code, but am unsure where to put it and how to update my table field:
If DatePart("d", emp1ti[,2]) = 2
Any help is much appreciated. I am new to VBA.