Referencing a sum query result in a text box

  • Thread starter Thread starter Darrell Cyphers
  • Start date Start date
D

Darrell Cyphers

How does one go about getting the result of a sum query to
appear in a text box?
 
Darrell,

It depends really on the specifics of what you mean. If you have a
query that just returns one value, or one record, you could use an
expression similar to this in the Control Source of your textbox,
presumably on a form or a report...
=DLookup("[NameOfTotalField]","NameOfQuery")
If you have a query that produces totals according to groupings of your
data, and if this is related to the other data in the form/report, and
if a form, assuming you don't need to edit or enter data, you can
probably include the totals query into the existing query that the form
is based on.
If this doesn't help, please post back with more details of what you are
trying to achieve.
 
How does one go about getting the result of a sum query to
appear in a text box?

The query returns just one row?
=DLookUp("[FieldName]","QueryName")
 
It was a single result, so the provided code worked
perfectly! Thank you!
 
yes. So...the provided code worked perfectly! Thank you!
How does one go about getting the result of a sum query to
appear in a text box?


The query returns just one row?
=DLookUp("[FieldName]","QueryName")
 

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

Back
Top