Adding Criteria to Access Reports

  • Thread starter Thread starter lil lam
  • Start date Start date
L

lil lam

Hi,

I need help with adding a criteria to my access report.

I have a report. On the top of the report I added a Total in the Page
Header to calculate the total of my amount field in all of my records.
I used the formula =Sum([amount]) to create this.

However, now I want to add a criteria to the records.
I want records to only show on the report only if the amount is
greater than $25k.
BUT - I don't want the Total to change. The Total should be the sum of
ALL records, including everything less than and greater than $25k.
And the detail records in the report should only contain records with
amount greater than $25k.

Would I use the DCount function for this? And if so, where do I put
the formula? In the query or in the design view of the report?

Thank you.
 
Would it be easier to do that in your query? Put [What is the amount?] as a
criteria and then enter <25000 or whatever you want when the parameter query
runs.
 
lil said:
I need help with adding a criteria to my access report.

I have a report. On the top of the report I added a Total in the Page
Header to calculate the total of my amount field in all of my records.
I used the formula =Sum([amount]) to create this.

However, now I want to add a criteria to the records.
I want records to only show on the report only if the amount is
greater than $25k.
BUT - I don't want the Total to change. The Total should be the sum of
ALL records, including everything less than and greater than $25k.
And the detail records in the report should only contain records with
amount greater than $25k.

Would I use the DCount function for this? And if so, where do I put
the formula? In the query or in the design view of the report?


You could use DSum, but it would require the same criteria
as the report's record source query and you may not be able
to predict what that will be. You could probably figure out
what was actually used for the report and (re)construct it
for the DSum.

A different idea would be the crude, but simple, approach of
just making the detail section invisible when the amount is
less than 25K. You could even arrange to make the 25K a
parameter similar to the report's criteria.

Me.Section(0).Visible = (Me.Amount >= 25000)
 
Back
Top