A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Simple Sum



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 04:00 PM
youngnwithqs
external usenet poster
 
Posts: n/a
Default 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  
Old June 5th, 2004, 09:51 AM
Steve Schapel
external usenet poster
 
Posts: n/a
Default 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  
Old June 7th, 2004, 07:04 PM
youngnwithqs
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.