The code arne provided is correct and is useful to give you an error message but isn't sufficient to protect the integrity of the database. You also need a composite unique index. This will cause the database engine to prevent duplicates from being saved REGARDLESS of what process tries to save them. For example, if you import a file of ticker symbols, the code on the form does you no good. Duplicates can be added to the table. Only defining a unique index on the table itself will prevent the duplicates. The way the index dialog works is you create a new entry with an index name, pick the first field and select the index properties, Then on the next line, leave the name empty so Access knows that this is to be part of the previously named index and pick the second name. Then a third if necessary up to a max of 10 fields. Other RDBMS' allow more columns in indexes than does Access.
View attachment 86929