If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Simple Sum
I am trying to add the value of job lengths when the job is checked in a 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 time length the job should take if the box is check, and then adding these 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'm 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). Can anyone explain where I'm messing up? Josh (this is my first post, so excuse the length of it) ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
|
|||
|
|||
Simple Sum
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])) -- Steve Schapel, Microsoft Access MVP youngnwithqs wrote: I am trying to add the value of job lengths when the job is checked in a 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 time length the job should take if the box is check, and then adding these 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'm 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). Can anyone explain where I'm messing up? Josh (this is my first post, so excuse the length of it) |
#3
|
|||
|
|||
Simple Sum
Thanks for your help. The second one works for me (the abs one). ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Thread Tools | |
Display Modes | |
|
|