Deleting Duplicates

  • Thread starter Charles Phillips
  • Start date
C

Charles Phillips

Hello,
I have an MS-Access 97 database, that I am cleaning up.
Are there examples of VBScripts or VBA code, I can use to delete duplicate
files??? Better yet, is there code that can be activated through a
buttom????

Thank you,
Charles L. Phillips
 
C

Charles Phillips

Hello,
I'm sorry, I mean duplicate fields in a table, in a database...
 
T

Tim Ferguson

I'm sorry, I mean duplicate fields in a table, in a database...

Duplicate fields?? Or do you mean duplicate records?

There is a wizard that will help you create a query that will identify
records that are duplicated on a particular set of fields, which
basically goes something like

SELECT OneField, TwoField, ThreeField,
COUNT(*) AS NumOfRecords
FROM MyTable
GROUP BY OneField, TwoField, ThreeField
HAVING COUNT(*) >1
ORDER BY OneField, TwoField, ThreeField

This will identify groups of duplicates: how you decide which one to keep
and which one(s) to remove is up to you.

In the meantime, you might take time to plan how to avoid the same thing
coming up again -- judicious use of Unique Indexes, suitable
ValidationRules, even coding behind the form's BeforeUpdate event and so
on.

Hope that helps


Tim F
 
C

Charles Phillips

Hello,
This info helps a great deal.
I was given this project, because the previous Project Analyst quit.
Any further suggestions...

Thank you,
Charles L. Phillips
 
T

Tim Ferguson

I was given this project, because the previous Project Analyst quit.
Any further suggestions...

Something along the lines of a course or self-induced primer on basic R
theory and relational databases -- there is a body of knowledge you need to
bring to any project in Access. It's not a lot and it's not hard, but
Access is not really an end-user tool in the way that Word and Powerpoint
are.

Oh -- and any questions are always welcome here, of course!

All the best


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top