Hi all!
I have looked at lots of websites with potential answers and none of them fit what I'd like to do.
I have a table of installation specs. There is also a table of part numbers and a another table that links the two together.
The installation specs have an autonumber ID but they also have a unique drawing number. The drawing numbers have already been created by the company and I can't change those.
The form I created to enter the specs is a main form where the user can enter the drawing number and a description. A sub-form allows the entry of part numbers and quantities.
This is all pretty standard .... your basic invoice number and invoice detail except the user is entering the invoice number.
To prevent duplicate drawing numbers, I set the field to index with no duplicates. it works just fine ... except ...
The error about the duplicate value doesn't appear until after the record is saved, which means the user has entered the drawing number, description and a bunch of parts before finding out that the drawing number is a duplicate.
The error message that appears would completely confuse the users.
I used VBA for the lost focus event of drawing number field to save the record ... at least the error pops up before more data is entered.
Now, how do I have a custom error message for just the duplicate index error?
The default message doesn't give me an error number, so I can't use an if-then error handler based on an error number.
Does anyone know the specific error number? I found an old website that said the error was 3022 ... but, I think that was for the JET engine and doesn't Access use ACE now? (if that even matters)
I've tried putting code in the lost focus for the drawing number field based on error number 3022 ... no dice. I tried in in the overall form error event, again didn't work.
Can someone point me in the right direction?
Thank you!
Susie
Kansas