Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-28-2019, 03:21 AM   #1
aattas
Newly Registered User
 
Join Date: Dec 2014
Posts: 60
Thanks: 12
Thanked 0 Times in 0 Posts
aattas is on a distinguished road
Count but not the repeated ones

Experts,
I think this is a very simple question but nothing works for me.

How can i tell the report not to count repeated numbers?

I did declare to hide the duplicates and still it is counting.

I tried to defined a specific field =str(Count(ref)) but still it is counting as if it is still there.

Thanks

aattas is offline   Reply With Quote
Old 10-28-2019, 03:47 AM   #2
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,479
Thanks: 0
Thanked 578 Times in 574 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: Count but not the repeated ones

Build a query that aggregates data so values are not duplicated and use that as report recordsource. Provide sample of data or attach database.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is online now   Reply With Quote
The Following User Says Thank You to June7 For This Useful Post:
Tera (10-28-2019)
Old 10-28-2019, 04:05 AM   #3
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,382
Thanks: 115
Thanked 3,114 Times in 2,831 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Count but not the repeated ones

Hiding the duplicates just stops them being displayed but they are still there.
As June said, create your report using a query with no dupes e.g. Try SELECT DISTINCT

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Tera (10-28-2019)
Old 10-28-2019, 05:26 AM   #4
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Count but not the repeated ones

this will work on Print Preview only:
Code:
Dim dict As Object
dim lngCount As Long

Private Sub Report_Open(Cancel As Integer)
    Set dict = CreateObject("scripting.dictionary")
End Sub

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If dict.Exists([TextboxNameToCount] & "") = False Then
        lngCount = lngCount + 1
        dict.Add [TextboxNameToCount] & "", [TextboxNameToCount]
    End If
    Me.TextboxToDisplayCount = lngCount
End Sub
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 10-28-2019, 06:18 AM   #5
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,656
Thanks: 58
Thanked 1,463 Times in 1,444 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Count but not the repeated ones

Hi. You might also be able to use Grouping in your report to do the counting. Just a thought...

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Count the Two combination fields repeated gramesh General 4 02-27-2016 09:25 PM
Repeated code fat controller Modules & VBA 3 11-26-2014 03:04 AM
Repeated query to VBA Timoo Modules & VBA 11 11-05-2012 08:31 AM
How do I stop name being repeated? kimberlin Queries 6 08-01-2011 11:29 AM
Repeated results XaloRichie Queries 2 09-08-2003 09:46 AM




All times are GMT -8. The time now is 02:09 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World