ACC: How to Delete Duplicate Records from a Table

Last reviewed: February 4, 1998
Article ID: Q109329
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SUMMARY

Novice: Requires knowledge of the user interface on single-user computers.

This article describes how to remove duplicate records from a table by using primary keys. By using this method, you can check for duplicate values in up to 10 fields in the table.

MORE INFORMATION

To remove duplicate records from a table, follow these steps:

  1. Make a copy of the table from which you want to remove the duplicate records. To copy a table, select the table in the Database window, and then click Copy on the Edit menu. Click Paste on the Edit menu. Enter a new name for the table, select Structure Only, and then click OK.

  2. Open the new table in Design view, and select the field(s) which you want to check for duplicates. To make your selection the primary key for the table, click the Primary Key button on the toolbar.

  3. Save and close the table.

  4. Create an append query, and append the data from the original table to the new table. Because the primary key fields in the new table will not permit duplicates, you receive the following error message:

    In Microsoft Access 7.0 and 97:

          Microsoft Access can't append all the records in the append query.
    

    In earlier versions:

          Errors were encountered...Proceed anyway?
    

    Click OK. The new table will contain the data from the original table, but will not have duplicates.

NOTE: A fast way to remove duplicate records from a small table is to select the table in the Database window, click Copy on the Edit menu, and then click Paste on the Edit menu. In the Paste Table As dialog box, type the name of the table created in Step 1 in the Table Name box, and select the Append Data To Existing Table button. When you click OK, the records will be appended from the original table, without the duplicate records.

REFERENCES

For more information about deleting duplicate records, type "delete duplicate records" in the Microsoft Access 97 Office Assistant, click Search, and then click to view "Automatically delete duplicate records from a table."

Keywords          : QryMktbl kbusage kbfaq
Version           : 1.0 1.1 2.0 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 4, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.