Solved

Count unique records in detail section of report

Posted on 2015-02-02
1
173 Views
Last Modified: 2015-02-02
I've tried various queries to resolve this issue but so far no luck.  So I want to try a new approach.

I have a report that has a grouping.  In the group is a detail section that has a field named POn.  Also in the detail section of a field named POnCount.  I don't know if the VBA code I'm looking for is in the onprint or onformat event of the detail section but every time a new POn is found, increment the POnCount by 1.  If the POn was already cycled through then don't increment by 1.

The after the group has printed set the POnCOunt over at 0.

How can this be done?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40584050
If the report is sorted by POnCount, then add a grouping footer and let Access do the work for you.  No code required.  You don't even have to have a visible control in the footer.  Add a control, make it very small so the footer won't take up a lot of room.  Name it CountPO.  Set its ControlSource to:
=1
Set the Grouping property to OverAll.  Add a control to the report footer to display the value.
=CountPO

If not, then you will need to create a separate query that does the counting.  You can add a subreport to the report footer to display a recap that gives you the counts you want.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question