calculations that need to come from another table

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

Guest

I have a group header that shows the managers name and displays a summary of
the type of hours worked by the manager's employees, for example:
Manager|__|sick hours|__|vacation|__|Holiday|
-----------------------------------------------------------------------
Manager 1 47 35 40
Manager 2 22 15 30
etc....
___________________________________________________
In another table, I have the list of the employees, their manager, and the
number of hours they are scheduled to work each week.
Is there any way to insert that sum at the end of each manager row?
for example: Manager 1 has 10 employess that work 40 hours each.
Manager|__|sick hours|__|vacation|__|Holiday|_____|Total Hours
-------------------------------------------------------------------------------
Manager 1 47 35 40 400
Manager 2 22 15 30 280
etc....
_________________________________________________________
Hopefully that was enough explanation...let me know if you need any more.
Thanks!
 
Use the dsum function, and bound the total houres field to it

=dsum("HoursInEmployess","EmployeesTableName","ManagerIdinEmployees = " &
[ManagerFieldNameInReport]) ' If manager id is number

=dsum("HoursInEmployess","EmployeesTableName","ManagerIdinEmployees = '" &
[ManagerFieldNameInReport] & "'") ' If manager id is string
 
I think it would be more efficient to create a totals query of "another
table" that totals the scheduled hours by manager. Then add this totals
query to your report's record source and join the manager ids.

--
Duane Hookom
MS Access MVP
--

Ofer said:
Use the dsum function, and bound the total houres field to it

=dsum("HoursInEmployess","EmployeesTableName","ManagerIdinEmployees = " &
[ManagerFieldNameInReport]) ' If manager id is number

=dsum("HoursInEmployess","EmployeesTableName","ManagerIdinEmployees = '" &
[ManagerFieldNameInReport] & "'") ' If manager id is string


Jeffshex said:
I have a group header that shows the managers name and displays a summary
of
the type of hours worked by the manager's employees, for example:
Manager|__|sick hours|__|vacation|__|Holiday|
-----------------------------------------------------------------------
Manager 1 47 35 40
Manager 2 22 15 30
etc....
___________________________________________________
In another table, I have the list of the employees, their manager, and
the
number of hours they are scheduled to work each week.
Is there any way to insert that sum at the end of each manager row?
for example: Manager 1 has 10 employess that work 40 hours each.
Manager|__|sick hours|__|vacation|__|Holiday|_____|Total Hours|
-------------------------------------------------------------------------------
Manager 1 47 35 40
400
Manager 2 22 15 30
280
etc....
_________________________________________________________
Hopefully that was enough explanation...let me know if you need any more.
Thanks!
 
Back
Top