Count but not the repeated ones

aattas

Registered User.
Local time
Today, 21:53
Joined
Dec 24, 2014
Messages
75
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
 
Build a query that aggregates data so values are not duplicated and use that as report recordsource. Provide sample of data or attach database.
 
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
 
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([[I]TextboxNameToCount[/I]] & "") = False Then
        lngCount = lngCount + 1
        dict.Add [[I]TextboxNameToCount[/I]] & "", [[I]TextboxNameToCount[/I]]
    End If
    Me.[I]TextboxToDisplayCount[/I] = lngCount
End Sub
 
Hi. You might also be able to use Grouping in your report to do the counting. Just a thought...
 

Users who are viewing this thread

Back
Top Bottom