By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

Use requery to get total of a subform

100+
P: 116
Hi.
I have tried every avenue such as REQUERY, REPAINT, REFRESH but nothing seems to work. Basically i have a subform with a list of values. at the end of the list there is another subform with all these added together by doing a query to show the sum.

I have created a button which will refresh the totals subform when i want. However i dont want this as I want the totals to refresh everytime I add a new record ( I presume on the After update event.) Nothing works.

I have attached my example

Thanks
Jacc14
Attached Files
File Type: zip requery.db1.zip (18.3 KB, 56 views)
Jul 22 '10 #1

✓ answered by patjones

Let me know if my modification works for you. I removed the second subform and command button as I think they are not necessary in your situation. The AfterUpdate event for the first subform is the way to go.

Pat

Share this Question
Share on Google+
5 Replies


patjones
Expert 100+
P: 931
Let me know if my modification works for you. I removed the second subform and command button as I think they are not necessary in your situation. The AfterUpdate event for the first subform is the way to go.

Pat
Attached Files
File Type: zip requery.db1.mdb.zip (24.7 KB, 61 views)
Jul 22 '10 #2

100+
P: 116
@zepphead80
Hi There. thank you for this. Works perfect for my value field which is input direct into the table. However I intend to add a calculated field to my query and also sum this as well. This means it wont actual be a value held in the table. Is there anything similar i can do but from the query instead.

Thanks
Christine
Jul 22 '10 #3

100+
P: 374
@jacc14
You can use DSum with a query also Christine.
Jul 22 '10 #4

patjones
Expert 100+
P: 931
I should point out that a query can be used as the domain in the second argument of DSum instead of a table. If you are going to base everything off a single query you should still be able to set the text box value to the DSum lookup.

Pat
Jul 22 '10 #5

100+
P: 116
Dear Pat / Munkee

Result. I have dragged the figures in from the query. Thanks both for your assistance.

Christine
Jul 22 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.