Re: Expression that won't do a formula, acts as Parameter
- From: Michelle <Michelle@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 20 Jan 2008 12:14:00 -0800
Hi Tom
First of all, thanks so much for the help. It was such a relief to check in
this morning and see another post. But, I'm still having troubles. If I use
the expression builder, the text box stays unbound, and the formula won't
display. If I type it into the text box directly, I get "#Error" on the
report. Can you tell from that info what I'm messing up now?
Thanks Again
Michelle
"Tom Wickerath" wrote:
Hi Michelle,.
You cannot reference the Kin's Total and Kin's payment total queries in this
manner. You have a couple of choices here:
1) Use the Domain Aggregrate Function DSum. For example:
=DSum("FieldName", "TableOrQueryName", "OptionalCriteria")
In your case, since you are referencing two sums, invoice total and payment
total, you can string two DSum statements together. Something like this, but
all on one line in the control source for the textbox:
=DSum("PaymentsFieldName", "TableOrQueryName", "OptionalCriteria") -
DSum("InvoicesFieldName", "TableOrQueryName", "OptionalCriteria")
If the payment and invoice data is in the same field, then the first example
should do the trick. See the following page on the MVPS web site for more
help on using Domain Aggregrate functions:
DLookup Usage Samples
http://www.mvps.org/access/general/gen0018.htm
2) The second option, which is not as easy to implement, would involve using
a subreport to display the individual records that make up each sum (you can
hide the detail section). Then, in the footer of the subreport, you have text
boxes that sum the various quantities. You can then use an expression to
display these values on your main report.
I think since you indicated that you are rusty with Access, I'd stick with
using the Domain Aggregrate Function method. Hoping you did not have Access
nightmares...
Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
"Michelle" wrote:
Hi Linq
Kin's Total and Kin's payment total are both queries that do nothing but add
up all the invoices and all the payments. I used the expression builder and
double clicked them from the list in the builder. The expression is in a
text box in a report footer. Does that make any sense?
Thanks Again
Michelle
- References:
- Re: Expression that won't do a formula, acts as Parameter
- From: Linq Adams via AccessMonster.com
- Re: Expression that won't do a formula, acts as Parameter
- From: Tom Wickerath
- Re: Expression that won't do a formula, acts as Parameter
- Prev by Date: Re: code will and won't work
- Next by Date: Re: Expression that won't do a formula, acts as Parameter
- Previous by thread: Re: Expression that won't do a formula, acts as Parameter
- Next by thread: Re: Expression that won't do a formula, acts as Parameter
- Index(es):
Relevant Pages
|