Delete duplicate records from a table (MDB)

Microsoft Office Access 2003

Show All Show All

Delete duplicate records from a table (MDB)

Note  The information in this topic applies only to a Microsoft Access database (.mdb).

Deleting duplicate records from a table requires two steps. First, you create a copy of the structure of the table that contains duplicates, and then make primary keys of all the fields that contain duplicates. Second, you create and run an append query from the original table to the new table. Because fields that are primary keys can't contain duplicate records, this procedure produces a table without duplicate records.

  1. Copy the table and make primary keys of fields with duplicates.

    ShowHow?

    1. In the Database window, click Tables Button image under Objects.
    2. Click the name of the table you want to delete duplicate records from.
    3. Click Copy Button image on the toolbar.
    4. Click Paste Button image on the toolbar.
    5. In the Paste Table As dialog box, type a name for the copied table, click Structure Only, and then click OK.
    6. Open the new table in Design view, and select the fields that contained duplicates in the table you copied.
    7. Click Primary Key Button image on the toolbar to create a primary key based on the selected fields.
    8. Save and close the table.
  2. Append only unique records to the new table.

    ShowHow?

    1. Create a new query based on the original table that contains duplicates.
    2. In query Design view, click Query Type Button image on the toolbar, and then click Append Query.
    3. In the Append dialog box, click the name of the new table in the Table Name list, and then click OK.
    4. Include all the fields from the original table by dragging the asterisk (*) to the query design grid.
    5. Click Run Button image on the toolbar.
    6. Click Yes when you receive the message that you're about to append rows.
    7. Click Yes when you receive the message that Microsoft Access can't append all the records in the append query. This transfers only unique records to your new table and discards the duplicates.
    8. Open the table to see the results.
    9. When you're sure the new table has the correct unique records, you can delete the original table, and then rename the new table using the name of the original table.