duplicate entries

T

Trisha

I've got a field in a form named strMRNumber. I've got the No Duplicates
property set. However, I get a generic "can't save record because of
duplicate value" response. I'd like the user to have a more detailed
explanation of why they can not save the record. Is this possible?
 
M

Michel Walsh

Hi,



In the form Error event procedure, check the error code (first argument),
and if it correspond to the error you expect, supply the message and supply
the value acDataErrContinue to the second argument:


Private Sub Form_Error(DataErr As Integer, Response As Integer)
If 3022=DataErr then
MsgBox "Hi"
Response = acDataErrContinue
End If
End Sub




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top