Refresh DSUM Values

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have several DSUM fields on a form. The fields are looking for values from a Query:

=DSum("MONTH0_Active","qry_OnTimeDelivery_MetricData")

But unless I have the query open at the same time as I have the Form open, I don't get values. How can I get this to calculate without having to open the query - or is that not possible?
 
Re: Access: Refresh DSUM Values

To expand upon my previous post, all bound queries have a data source (where the information is coming from). It is either a Table or a Query.
If it is a Query, all you need to do is add a Calculated field to your Query that does the calculation that you want (so the calculation is done in the Query and not on the Form)
Code:
[COLOR=#333333]MyCalc: DSum("MONTH0_Active","qry_OnTimeDelivery_MetricData")[/COLOR]
Then, just pick that field from the Field Selector on your Form to add it.

If your Form is using a Table as your Data Source, create a new Query that adds all the fields from the Table that you want, and then add the Calculated Field, like above.
Then, change your Form to use thre Query as the Data Source (instead of the Table), and add your Field from the Field Selector to the Form.
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top