I have a subform in Access 2010 that lists the costs associated with different parts of a project. On another page, I have a TotalValue
field that takes the sum of the costs for each project, and multiplies it by 1,000,000. Originally, I had just Parent.[TotalValue] = Me.Est_Value.Value * 1000000
, but that didn't sum the costs. So I tried adding a DSum
, but it's giving be a runtime error 424: Object Required
at the DSum
line.
Private Sub Est_Value_AfterUpdate()
Me.Recalc
Parent.[TotalValue] = DSum(Projects.EstValue,
Projects, Projects.ProjNo = Activity.ProjNo) * 1000000
Parent.[UpdatedCosts] = Date
Parent![Updated Costs].Requery
Parent!Text263.Requery
End Sub
I'm not really sure what's wrong with it, so I would appreciate any help.
I don't really have any working examples of this. But based off of what I am reading here: http://www.techonthenet.com/access/functions/domain/dsum.php
It should look more like this:
This is assuming
Activity.ProjNo
is a form property and thatProjects.ProjNo
is an numeric field.Update: From further discussion the
Activity.ProjNo
was not the control that contained theProjNo
value and it wasMFProjectsSubform.ProjNo
instead. So the code should look like: