Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return DAO rs.RecordCount for rs.FindFirst

Status
Not open for further replies.

sanders720

Programmer
Aug 2, 2001
421
US
This must be really simple, but I can't find it anywhere. I want to perform a findfirst in DAO and then see if the recordcount matches the current recordcount in a loop. This ultimately tests for duplicate data.

Thanks in advance for your help!!!
 
RecordCount is a property of a recordset that indicates the total number of records. Unless you're adding or deleting records, which you didn't mention, it will not change when you do FindFirst. Are you talking about a record number perhaps? And how will you determine the "recordcount in a loop"? Rick Sprague
 
Why don't you test for duplicate data by opening a recordset of duplicate records?

Select DuplicateField, Count(DuplicateField) As NoOfDups From Table Where Count(DuplicateField)>1 Group By DuplicateField;

Such recordset will already return the duplicates...

Your way would need a variable holding the number of matches, reset each time you start a new loop. Maybe an array...

HTH

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top