UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Sum For List Boxes, Access 2016    
 
   
Aakburns
post May 21 2020, 10:46 AM
Post#1



Posts: 36
Joined: 4-December 19



I have this form setup to total each day of the week hours into decimal hours automatically. However I need to total those hours for each day together. I have a decimal total field, I've tried this as a text box with an expression and as a query using another list box. They work but I have to select each Dec box total for it to show the added math in the Decimal Total.

Is there an easier way to do this? I need it to simply sum all Dec. boxes together without any other interaction.

Each Dec. total box is a list box, so that I could set the boxes for times to requery each when updated the times are updated or entered..


I've tried this as an expression.
QUOTE
=[Monday_Dec]+[Tuesday_Dec]+[Wednesday_Dec]+[Thursday_Dec]+[Friday_Dec]+[Saturda
y_Dec]+[Sunday_Dec]


and

QUOTE
=Sum([Monday_Dec]+[Tuesday_Dec]+[Wednesday_Dec]+[Thursday_Dec]+[Friday_Dec]+[Sat
urday_Dec]+[Sunday_Dec])


Also, as a query as

QUOTE
Decimal_Total: [Monday_Dec]+[Tuesday_Dec]+[Wednesday_Dec]+[Thursday_Dec]+[Friday_Dec]+[Saturday
_Dec]+[Sunday_Dec]

Attached File(s)
Attached File  access_totals.jpg ( 35.67K )Number of downloads: 0
 
Go to the top of the page
 
nuclear_nick
post May 21 2020, 10:59 AM
Post#2



Posts: 1,873
Joined: 5-February 06
From: Ohio, USA


How is the rest of the form filled out? is the data being entered or just presented with the form? Are these...
QUOTE
=Sum([Monday_Dec]+[Tuesday_Dec]+[Wednesday_Dec]+[Thursday_Dec]+[Friday_Dec]+[Sat
urday_Dec]+[Sunday_Dec])

… meaning the "Monday_Dec" etc.. fields in the query AND the names of text boxes on the form?

--------------------
"Nuclear" Nick
____________
The top three reasons to hide code; 1) It's not your own. 2) It's your own, but it's so crappy you don't want anyone to see it. 3) The comments in your code would get you in a lot of trouble if ever made public.
Go to the top of the page
 
Larry Larsen
post May 21 2020, 02:10 PM
Post#3


UA Editor + Utterly Certified
Posts: 24,589
Joined: 26-August 02
From: Melton Mowbray,Leicestershire (U.K)


Hi
Just an idea.. could you use the "Tag" property of each listbox control and then total as you loop through each control..
thumbup.gif

--------------------
"Time...We have exactly the same number of hours per day that were given to Helen Keller, Pasteur, Michaelangelo, Mother Teresa, Leonardo da Vinci, Thomas Jefferson, and Albert Einstein"
H. Jackson Brown
Go to the top of the page
 
RJD
post May 21 2020, 02:39 PM
Post#4


UtterAccess VIP
Posts: 10,580
Joined: 25-October 10
From: Gulf South USA


Hi: I don't think we have the complete information we need here. Could you post a db with relevant objects, no sensitive data, zipped? That way I think a solution could be forthcoming quickly.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
Aakburns
post May 21 2020, 04:19 PM
Post#5



Posts: 36
Joined: 4-December 19



This shows, the Label names. I just need to add up these list boxes based on the first row into to show in the Decimal Total, which is a qry that says to add them. However it actually works currently, but I have to click each Dec. box for it to show the total right now.
Attached File(s)
Attached File  access_totals2.jpg ( 541.51K )Number of downloads: 2
 
Go to the top of the page
 
RJD
post May 21 2020, 04:30 PM
Post#6


UtterAccess VIP
Posts: 10,580
Joined: 25-October 10
From: Gulf South USA


Hi: I think without having the db (or a copy with relevant objects and example data) we are just guessing in the dark and probably will not be able to help you except by chance. Could you, as I requested before, post a db (not an image, but an actual attached zipped accdb) for us to work with? You are using some terms that are throwing us off (such as "Label" when you should be working with textbox controls, or "list boxes" where they might not actually be Access ListBoxes at all). The db will clarify all that for us. Thanks.

Looking forward to seeing your db and assisting ...

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
projecttoday
post May 21 2020, 05:04 PM
Post#7


UtterAccess VIP
Posts: 12,392
Joined: 10-February 04
From: South Charleston, WV


What kind of form is it? (Continuous?) If you don't want to post the database post the table layout.

--------------------
Robert Crouser
Go to the top of the page
 
June7
post May 21 2020, 05:59 PM
Post#8



Posts: 1,527
Joined: 25-January 16
From: The Great Land


Those look like textboxes, not listboxes.

Data structure is not normalized and that is true root of issue.


--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    9th July 2020 - 01:04 PM