[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Dsum help

Posted on 2013-12-04
5
Medium Priority
?
341 Views
Last Modified: 2013-12-05
Experts,

I have the following Dsum in a subform:

=DSum("[USDEquiv]","tblFXRates","[ProjID]=" & Nz([ProjID],0))

Wouldnt this Sum all USDEquiv for ProjID = ProjID?

USDEquiv is a calculated field (see pic).  the Dsum is not summing and only thing I can think of is USDEquiv is a calcualted field and not a field in tblFXRates.   The ProjID's are populated.

here is the calcualted field as shown in the pic:
USDEquiv: IIf([CurrencyID]=1,[tblFXRates].[Amount],([tblFXRates].[Amount]*[ExchangeRate]))

thank you.

tblFXrates,query
0
Comment
Question by:pdvsa
  • 2
  • 2
5 Comments
 
LVL 40

Assisted Solution

by:PatHartman
PatHartman earned 2000 total points
ID: 39696857
The picture is a little blurry but the field you are referencing is not in tblFXRates.  Change the DSum() to reference the query you show in the picture.  For most purposes, tables and select queries are interchangeable.
0
 
LVL 15

Expert Comment

by:JimFive
ID: 39696859
You need to DSUM on the query that contains the calculation not the table.
0
 

Author Comment

by:pdvsa
ID: 39697033
OK.  I guess I need to make a saved query because the query only resides on the record source of form?
0
 
LVL 40

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 39697321
Yes.  Create a querydef and then reference it from both places.
0
 

Author Closing Comment

by:pdvsa
ID: 39698287
thank you....will be asking a similar question in just a minute.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question