If you are prompted for a value, it means that the prompt
string is a name that Access can not resolve. Make careful
not of the prompt and then look for it in the report's
record source query, as the control source of a bound
control or as a field in the Sorting and Grouping window.
When you find it, fix the spelling. If it is not a field
name, then you are doing something the wrong way (possible
your attempt to "point" to this "external" query?)
As I tried to say before, I don't see why you need this
extra query. Did you try using the Sum and DSum functions?
Thanks for your response, Marsh. Even thou I'm an advanced .NET
developer, I don't know much about Acess - I've been trying to help my
wife who's learning it and decided to create our home account
management using it (crazy, isn't she?
). Forget about the external
query, but how do I sum all the records at my Incomes table and
present it in my report Text Box? I tried the following formulas
without success (it keeps asking for an input)
Directly from my table: =Sum([Incomes]![Incomeamount])
From my query (which sums all my incomes): =Sum( [qryincomeQuery]!
[SumOfIncomeamount] )
Your attempts to use Sum failed because the field is not in
the report's record source table/query.
Sum only works for fields in the report's record source
table/query. This menas that if you want to sum all the
values displayed in the report, you can use a text box
expression like =Sum([the field name])
Note that Sum is not aware of controls in the report so you
can not sum values calculated in a text box. This means
that if you have a text box named Aount with the expression
=Price*Quantity, you can not use =Sum(Amount). You need to
use =Sum(Price*Quantity) instead
If you want to sum a field from some other table/query, then
you can use the DSum function in a text box expression:
=DSum("[the field name]", "the table/query name")
The Domain aggregate functions (DCount,DSum,etc) will
construct the analogous query, run it and return the
resulting value so they are a convenient way to get a single
value.
Side note: when it necessary to use a table name to
disambiguate a field name, the "correct" syntax is to use
dot instead of bang. In an attempt to appeal to all skill
levels, Access sometimes accepts either, but rather than try
to remember where the other one doesn't work, it's best to
use the right one everywhere. Generally, bang is used to
identify a member of a collection and dot is used with
fields, properties and methods.