Question about Unique Table Columns - How to Handle Alerts
I have a table with a unique column, and I want to provide an error alert when a user tries to insert a record in which there is another record that already has the same value for that column.
I tried just relying on the table constraint in the DB, but I just get a "cannot insert record" message on the form run-time.
I put a query in the PRE-INSERT trigger to query and see if that value exists in another record and display the alert there, but my concern is that a record could be inserted by another user after my check query runs. In that case, I will still just get the "cannot insert record" message.
What is a good way that I can give an error alert AND assure that another record is not being inserted in the mean time?
Thanks,
Kurz