troubleshooting Question

Duplicates Query

Avatar of pdvsa
pdvsaFlag for United States of America asked on
Microsoft Access
8 Comments3 Solutions27 ViewsLast Modified:
Experts,

I have an issue with duplicate invoice numbers.
I have a form built on tblPayments and [InvoiceNo] is the field I enter the invoice number.

I built a duplicates query as follows:
SELECT tblPayments.InvoiceNo, tblPayments.Amount, tblPayments.PaymentDate, tblPayments.ExpectedPmtDate, tblPayments.NotPaid, tblPayments.DateSentHB
FROM tblPayments
WHERE (((tblPayments.InvoiceNo) In (SELECT [InvoiceNo] FROM [tblPayments] As Tmp GROUP BY [InvoiceNo] HAVING Count(*)>1 )))
ORDER BY tblPayments.InvoiceNo;

When I tab out of [InvoiceNo] the AfterUpdate event fires and the query appears but it shows all duplicates and I dont want to see them all.  I want filter on the the current record [tblPayments.InvoiceNo], which would be the record I am entering.  


Let me know if it is not clear.
thank you...
ASKER CERTIFIED SOLUTION
Gozreh
Software Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros