LaurieHamlin
Programmer
I'm new to VB in Access. I'm developing a payroll database. I need to total hours in a subform by the type (regular, overtime) and employee (social security number). I've gotten it to total by type, but it adds for all employees and when I add the social security criteria it no longer works.
The subform is 'Hours Worked with Description' and is based on a table named 'Hours Worked table'. The main form is 'Hours Worked' which is based on 'Employees'. This is what I have:
=DSum("[Hours]","Hours Worked table","[Forms]![Hours Worked table]![Social Security] = " & [Forms]![Hours Worked]![Social Security] " And [Hours Worked table]!
The subform is 'Hours Worked with Description' and is based on a table named 'Hours Worked table'. The main form is 'Hours Worked' which is based on 'Employees'. This is what I have:
=DSum("[Hours]","Hours Worked table","[Forms]![Hours Worked table]![Social Security] = " & [Forms]![Hours Worked]![Social Security] " And [Hours Worked table]!
Code:
= 'b' ")
I've tried changing the social security criteria everyway I can think of. I'll also have to add a criteria for date so if anyone can tell me how to do all that, I'd appreciate it. I hate syntax!