Simple Sum

Y

youngnwithqs

I am trying to add the value of job lengths when the job is checked in
form. For my text box, i have the following value:

=DSum("[TimeSpent]","Turnarounds","[Do] = True")


I also tried an invisible textbox on eahc line that shows the tim
length the job should take if the box is check, and then adding thes
boxes together at the bottom. I am getting the invisible boxes to work
but not the sum box (yes this is a very rookie way to work, but I'
getting frustrated). I have the vallues as:
invisible box (amount)
=IIf(([Forms]![Turnarounds]![Do]=True),[Forms]![Turnarounds]![Timespent],0)
sum box: =Sum([Amount])

The first produces no result in the box and the 2nd produces a #Name
in my text box (i have a box for each just as i am testing them). Ca
anyone explain where I'm messing up?

Josh (this is my first post, so excuse the length of it
 
S

Steve Schapel

Josh,

Did you think your post was too long or too short?

Is Do the name of your Yes/No field/checkbox? I would try the control
source of the Amount textbox just like this...
=IIf([Do]=-1,[Timespent],0)
.... and I would try the total in the form footer like this...
=Sum(IIf([Do]=-1,[Timespent],0))
.... or, less intuitive but perhaps simpler...
=Sum(Abs([Timespent]*[Do]))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top