DSum in Report

G

Guest

Someone suggested I try this DSum, but it isn't exactly what I need because I
don't really need to sum anything. And, when any field the code is using in
the criteria is text instead of a number, it won't work for me. Can someone
suggest something different.

This is the example they gave me that they have used in a text box on a
report:
=DSum("P","qryMa","m=1 and v=1")
They are summing "P" for the query "qryMA" where "m"=1 and "v"=1.
They have setup multiple text boxes on their report to look like a
spreadsheet and it works very well for them.

But, I have a very complicated existing report. I need to add some
additional information. The information will come in as a list when I need
to show it as if it were record. (It needs to show as one line beneath each
corresponding part number on the report) The current report has a lot of
calculations in the underlying query. I really don't want to mess with the
existing query.

Is there some way, I can use a text box in a report to just call the
information from a different query...such as:
=("Qty","qryA","B=1" and "FPN=C188") And is there some way in the report
itself to connect the "FPN" finished part number - to the corresponding FPN
in the report?
I don't really think so, but thought I'd give it a try.
 
K

Ken Snell [MVP]

Perhaps the DLookup function is what you seek. Check it out in Help file and
post back if you have questions.
 
G

Guest

Thank you. DLookUp does bring the text in for me. But, I can't figure out
how to add criteria. I tried the following

=DLookUp("P","qryt","b=2 and f=1")
it just shows an error.
 
K

Ken Snell [MVP]

Are P, b, and f the names of fields in the query qryt? Are b and f numeric
fields?

--

Ken Snell
<MS ACCESS MVP>
 
K

Ken Snell [MVP]

Text fields, eh.... then the criterion expression must delimit the values
with ' characters:

=DLookUp("P","qryt","b='2' and f='1'")
 
G

Guest

Ta Da!
Thank you so much!

Ken Snell said:
Text fields, eh.... then the criterion expression must delimit the values
with ' characters:

=DLookUp("P","qryt","b='2' and f='1'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DSUM Report 3
Dsum in Report 4
Dsum in report header problem 6
DSum Problem 1
Dsum in Detail 1
DSum on a report 5
Dlook & DSum in Report and groups by Report Groupings 1
DSum with Criteria 8

Top