Duplicate Error message

vipersmind

it can't be!
Local time
Today, 23:21
Joined
Dec 26, 2002
Messages
82
I have set the primary key in my table and set the indexes to Yes(no duplicates) and this work fine. When the client enters a duplicate value the standard Access msg pops up.

Now what the client would like is for the msg to be something that they understand not a big paragraph. As they have many users they get the same question about what the message means and they want it to be more self-explanatory.
Where/how do I change the message??
:D
 
here some code from access help
just replace the msg with yours

in the form on error event
Const conDuplicateKey = 3022
Dim strMsg As String

If DataErr = conDuplicateKey Then
Response = acDataErrContinue


strMsg = "Each employee record must have a unique " _
& "employee ID number. Please recheck your data."
MsgBox strMsg, vbOKOnly, "Duplicate values Not Permitted"
End If
 
Thank you that worked perfectly ;)
 
Still get Access error message

Hi,

I also got the Access error message about duplicate values and I tried the code that bjackson suggested but I still get the standard Access error message.

When I click my save or quit-button I get the standard Access error message and when I enter a duplicate value and then try to go to design view I get the selfmade error message.

Does anybody have an idea what's wrong??

Thanx!
 
I looked up something different and it seems you can also check duplicate values with DLookUp.

I want to check if the value a person enters in the textfield "Number" is already in the table "ListItems", in the column "Number".

This is what I've got: DLookUp ("[Number]","[ListItems]","[Number] = " & Me!Number)
The textfield is a Bound textfield.

Surprise surprise, it doesn't work... again :rolleyes:

Can anybody help??
 
Hi everybody,

I still need help on this topic. Anybody got an idea?? :confused:

Thanx!
 

Users who are viewing this thread

Back
Top Bottom