Unanswered: error trapping a duplicate value in VB
I'm having a bit of trouble with a database I'm creating.
I have a form in access that adds a range of vouchers to the database. The user enters the start number in txtstart, the end number in txtend and the database adds a record for every number between these two numbers.
However, I want some error trapping in there so if the user trys entering data that will create a duplicate value in the database they will get a message box appearing informing them.
However, i'm not sure what code I would need in my vba to do this.
if they enter values that will create duplicates then an error message does appear but this is the standard microsoft one and if I was to add 100 records, then the same message would appear 100 times.
You do not need any special verification code: all you need to do is to create a unique index on the column containing the values that cannot be duplicated. Then, a simple error trapping mechanism would do the job in your application.