You lost me on the "Project =" & Project Reference Here) part. Quick
overview - I have two tables, one containing project specific details and the
primary key is Project #. Linked to the Activities table with a 1-many
relationship. Employees put time to projects by selecting the project # they
are working on, name, date and actual time. There is a form showing all
project details created directly from the Project table and the project
leader would like to see the number of actual hours put to the project right
on this form, not in a separate report as it is now. The first suggestion
for DSum gives me the sum of ALL actual hours to every project, not just the
one for the record I am viewing.
Thanks for your help!
Klatuu said:
Then you need to filter it by Project:
=DSum("[name of field from other table]", "name of table", "Project = " &
Project Reference Here)
I can't be more specific not knowing where you have the project code or what
data type it is.
--
Dave Hargis, Microsoft Access MVP
gump said:
Thanks for the prompt reply. This is working fine to give me the sum of ALL
records in my other table, but I wasn't clear enought on exactly what I
needed. My main table contains project specific info, and this is what the
form is created from. The other table, "Activities" tracks all time put to
these projects. I would like to show a sum of all time put to each
particular project, so that as you scroll through the Project forms, the sum
of Activity to that project changes. Using DSUM all 12000 hours show for
each project.
:
For this you would want the DLookup function
=DSum("[name of field from other table]", "name of table")
--
Dave Hargis, Microsoft Access MVP
:
Would like to add a text box that contains a calculated field containing info
from another table. Other than building a form off a query I don't know how
to do it. I thought putting =sum([name of field from other table]) would
work but it gives me #Error. The tables are related. HELP!