Well, you could:
1. When you leave the textbox where the user has inserted the SSN number perform a check on the existence of the SSN in your table (if it is a primary key, it is indexed and the search will not take long) and depending on the answer (OK, KO) allow or prevent the user to add the new record.
2. depending on the database you are using, trap the error -
Access has a specific error code for PRIMARYKEY replication and so does SQLServer and show the user a "nice" message. (I can help with the error codes, I used them in a couple of solutions. In SQLServer, use a stored proc )
The second solution is better if the duplication seldom occurs, so not to spend too much time in controlling the existence of the SSN number.
hob
Enter your message below
Sign in or Join us (it's free).