logo
search
Others

How to Prevent Duplicate Location Records in Microsoft Access Forms

Elise WilliamsElise Williams Oct 1, 2026 868 views

Question details

The user needs to prevent duplicate location entries in an Access form that utilizes cascading combo boxes and natural-key joins.

How to Prevent Duplicate Location Records in Microsoft Access Forms
Product
Microsoft Access
Device & OS
not provided
Scenario
Designing a continuous-forms subform with cascading combo boxes where two locations must not point to the exact same combination of geographic fields.
Observed behavior
The current database design allows users to enter duplicate location records pointing to the same parish.
Before you start

Ensure you have closed all active forms and created a backup of your Access database before modifying table schemas, as creating unique indexes will restrict new data entry and validate existing records.

Solution 1Recommended

Create a Composite Unique Index in Table Design

Applying a composite unique index ensures that the combination of Parish, District, and County remains unique across all records without restricting individual field values.

While natural keys are helpful for continuous forms and queries, using a composite unique index is crucial for preventing duplicate combinations. This setup allows the same parish name to exist in different districts, but completely blocks users from saving exact matching combinations across the indexed fields.

1
Open Table Design View

In Microsoft Access, right-click your underlying table (e.g., Locations_NatKey) in the Navigation Pane and select 'Design View'.

2
Access the Indexes Window

Click the 'Indexes' button located in the Show/Hide group on the Table Design ribbon.

3
Define the Composite Index Name

In the Indexes dialog, type a new index name (such as 'UniqueLocation') in the first blank row under the Index Name column. In the Field Name column, select 'Parish'.

4
Set Unique Property

With the new index name selected, look at the Index Properties section at the bottom of the dialog and set 'Unique' to 'Yes'.

5
Add Remaining Fields

In the immediate rows below (leaving the Index Name column blank), select 'District' and then 'County' in the Field Name column. This groups them into a single composite unique index. Save the table.

Free Microsoft Office alternative

Need a Lightweight Office Suite? Try WPS Office

While Microsoft Access handles complex database management, your daily document processing, data analysis, and presentation tasks can be completed seamlessly with WPS Office. Enjoy a familiar interface and robust tools without the hefty subscription fees.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Suite: Run the installer and follow the on-screen prompts to set up Writer, Spreadsheet, and Presentation tools on your device.
  3. 3. Open Your Documents: Launch WPS Office and directly open your existing DOCX, XLSX, and PPTX files with zero format loss.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats.Free, lightweight, and easy-to-use alternative for everyday office tasks.Built-in PDF editing, merging, and format conversion tools.Familiar user interface ensuring a smooth migration for MS Office users.
QA img-9

Frequently Asked Questions

Why does my cascading combo box allow duplicate entries?

By default, combo boxes merely select or input data. If the underlying table lacks a unique index constraint for those specific fields, the database form will inherently permit users to save duplicate combinations.

What is a composite unique index in Microsoft Access?

A composite unique index is a database constraint applied to two or more fields simultaneously. It ensures that while individual fields can have repeated values across rows, the specific combination of all fields grouped in the index remains strictly unique.

Should I use natural keys or surrogate keys for continuous forms?

Natural keys can simplify queries and easily support correlated combo boxes in continuous forms. However, in larger operational databases, surrogate keys (like AutoNumbers) are generally preferred because they improve system performance and simplify backend relationships.