Summing text box values?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Darla123
    New Member
    • Aug 2015
    • 26

    Summing text box values?

    Good morning everyone!
    I have a report that has a text box called "Reserve" whose control source is from a query, so based on a bunch of different things, the value on the text box is different on every page on the report. I am trying to add another text box that adds up all the different values in "Reserve". I've tried using "=Sum([Reserve])", I've tried using running sums in the properties, and all that ever happens is that it pulls the first value on the first page of "Reserve" and ignores the rest. What is the best way to accomplish this? Am I going down the wrong path trying to use the Running Sum property?
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Try changing the name of your textbox to txtReserve and then use
    Code:
    =Sum(txtReserve)
    I have found that reports get confused easily with names.

    Comment

    • Darla123
      New Member
      • Aug 2015
      • 26

      #3
      If I do that, when I run the report a box pops up saying "Enter Parameter Value" for txtReserve

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        See if one of the links in this post helps
        home > topics > microsoft access / vba > questions > calculate running sum on report> Post#2

        :)

        Comment

        • Darla123
          New Member
          • Aug 2015
          • 26

          #5
          I've read through all of that and tried the suggestions in the links, but no matter what, it won't add properly. I'm not sure where it's going wrong.

          Comment

          • mbizup
            New Member
            • Jun 2015
            • 80

            #6
            -->>> a text box called "Reserve"

            Just a sanity check here...

            You need to use the name of the underlying field from your query or table in your SUM, not the name of the text box.

            ie:
            =Sum(YourFieldN ame)

            Not
            = Sum(YourTextBox Name)


            Also, the textbox containing your sum needs to be placed in a group or report header or footer section.

            Comment

            • Darla123
              New Member
              • Aug 2015
              • 26

              #7
              The name of the field and the text box are both "reserve". I tried naming the text box something else in case that was the issue and =Sum(FieldName) still didn't add properly :(

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                Where did you place this text box? If you put it in the wrong scope it won't sum correctly.

                Comment

                • Darla123
                  New Member
                  • Aug 2015
                  • 26

                  #9
                  The Reserve box is in a group called Flag. I've put it there and I also tried it in the footer and still nothing. I'm tearing my hair out on this one.

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    You said
                    control source is from a query
                    Are you implying that the source for the report is different? What exactly is the source of data for Reserve?

                    Comment

                    • Darla123
                      New Member
                      • Aug 2015
                      • 26

                      #11
                      No, I hope I'm not working thing wrong and I'm sorry if I'm causing confusion. The source of the whole report is a query, reserve is a field in the query that is pulled into the report. We have 10 different shopping centers in our report and each one has a different value for reserve. That's what I want to total.

                      Comment

                      • Rabbit
                        Recognized Expert MVP
                        • Jan 2007
                        • 12517

                        #12
                        Have you tried renaming the field in the query and using that? Maybe you have conflicting object names.

                        Can you post the SQL of the query?

                        Comment

                        • Darla123
                          New Member
                          • Aug 2015
                          • 26

                          #13
                          Code:
                          SELECT tblUserPerms.UserPermsUsername, tblUserPerms.UserPermsMall
                             , DetailData.Mall_Id, Malls.Mall_Name_Short
                             , DetailData.Year1, DetailData.Main_Id
                             , MainCategory.Description, DetailData.Sequence
                             , MainCategory.Order, DetailData.Sub_Id
                             , SubCategory.Description, DetailData.Flag1
                             , DetailData.Priority, DetailData.Committed
                             , DetailData.Forecast, DetailData.Deferred
                             , DetailData.LifeSafety, DetailData.Appearance
                             , DetailData.Other, DetailData.Budget1
                             , DetailData.Budget2, DetailData.Budget3
                             , DetailData.Budget4, DetailData.Budget5
                             , DetailData.Comments, DetailData.Specs
                             , DetailData.BidOut, DetailData.Bid1
                             , DetailData.Bid2, DetailData.Bid3
                             , DetailData.ProjStart, DetailData.ProjCompl
                             , DetailData.Tenant, tblTenant.TenantName
                             , [Year Now] AS Yearnow, Malls.Reserve
                          FROM tblUserPerms 
                             INNER JOIN ((((DetailData 
                                INNER JOIN Malls 
                                   ON DetailData.Mall_Id = Malls.Mall_ID) 
                                INNER JOIN MainCategory 
                                   ON DetailData.Main_Id = MainCategory.MainCat_Id) 
                                INNER JOIN SubCategory 
                                   ON DetailData.Sub_Id = SubCategory.SubCat_Id)
                                LEFT JOIN tblTenant 
                                   ON DetailData.Tenant = tblTenant.TenantID) 
                                ON tblUserPerms.UserPermsMall = DetailData.Mall_Id
                          GROUP BY tblUserPerms.UserPermsUsername, tblUserPerms.UserPermsMall
                             , DetailData.Mall_Id, Malls.Mall_Name_Short
                             , DetailData.Year1, DetailData.Main_Id
                             , MainCategory.Description, DetailData.Sequence
                             , MainCategory.Order, DetailData.Sub_Id
                             , SubCategory.Description, DetailData.Flag1
                             , DetailData.Priority, DetailData.Committed
                             , DetailData.Forecast, DetailData.Deferred
                             , DetailData.LifeSafety, DetailData.Appearance
                             , DetailData.Other, DetailData.Budget1
                             , DetailData.Budget2, DetailData.Budget3
                             , DetailData.Budget4, DetailData.Budget5
                             , DetailData.Comments, DetailData.Specs
                             , DetailData.BidOut, DetailData.Bid1
                             , DetailData.Bid2, DetailData.Bid3
                             , DetailData.ProjStart, DetailData.ProjCompl
                             , DetailData.Tenant, tblTenant.TenantName
                             , [Year Now], Malls.Reserve
                          HAVING (((tblUserPerms.UserPermsUsername)=fOSUserName())
                                AND ((DetailData.Year1)=[Year Now]));
                          Last edited by zmbd; Nov 25 '15, 06:43 PM. Reason: [z{Please format SQL, Scipts, Tables using the [CODE/] tool :) }]

                          Comment

                          • Rabbit
                            Recognized Expert MVP
                            • Jan 2007
                            • 12517

                            #14
                            Sorry, I'm all out of ideas. I don't see anything that would cause this issue.

                            For testing purposes, you could try creating a new report and paring it down to the key components to see if the issue persists.

                            Comment

                            • Darla123
                              New Member
                              • Aug 2015
                              • 26

                              #15
                              ok, thank you for looking at it!

                              Comment

                              Working...