Duplicate Records (Display On Form)/No Duplicate Records (Display Single Record On Report) (1 Viewer)

lhooker

Registered User.
Local time
Today, 09:01
Joined
Dec 30, 2005
Messages
399
Is it possible to retrieve the count of duplicate records (produced from the query below) ? I want to see if there are any duplicate records, if so, then show them on a form. If no duplicate records, then display a report with the single record.

In (SELECT [First_Name] FROM [Location_Totals] As Tmp
GROUP BY [First_Name],[Middle_Name],[Last_Name],
[Attending_Location] HAVING Count(*)>1
And [Middle_Name] = [Location_Totals].[Middle_Name]
And [Last_Name] = [Location_Totals].[Last_Name]
And [Attending_Location] = [Location_Totals].[Attending_Location])
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:01
Joined
May 7, 2009
Messages
19,245
why do you need to find out whether there are duplicates when either way you will show the record/s anyway.
 

lhooker

Registered User.
Local time
Today, 09:01
Joined
Dec 30, 2005
Messages
399
To determine which process to take. By the way, both results will be on forms.
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:01
Joined
Sep 21, 2011
Messages
14,306
Won't you just get dupes if they exist and nothing if they do not, with that query?
 

lhooker

Registered User.
Local time
Today, 09:01
Joined
Dec 30, 2005
Messages
399
Yes, but how can I determine this from a query called by a form button or VBA ?
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:01
Joined
Sep 21, 2011
Messages
14,306
Do a DCount() on that query?
 

lhooker

Registered User.
Local time
Today, 09:01
Joined
Dec 30, 2005
Messages
399
That gave me the count. Thanks ! ! !
 

Users who are viewing this thread

Top Bottom