[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Count unique records in detail section of report

Posted on 2015-02-02
1
Medium Priority
?
175 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 39

Accepted Solution

by:
PatHartman earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

650 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