ACC: Macro to Check for Duplicate Values in a FieldLast reviewed: April 2, 1997Article ID: Q103135 |
The information in this article applies to:
SUMMARYNovice: Requires knowledge of the user interface on single-user computers. This article demonstrates how to use a macro using the DLookup() function to check for duplicate values in a field.
MORE INFORMATIONMicrosoft Access provides automatic checking for duplicate values in a field that has been designated as the primary key. However, this check occurs after all fields for a record have been entered, just before the record is committed to the database. The following sample macro is based on the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0) and will perform a duplicate check as the data in a field is entered:
REFERENCESFor more information about duplicate values in a field, search the Help Index for "duplicate values," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: validate same validationrule
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |