Solved

Count unique records in detail section of report

Posted on 2015-02-02
1
172 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

737 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