Primary Key Duplication Error Message (1 Viewer)

Bandara

Member
Local time
Today, 18:14
Joined
Apr 17, 2020
Messages
40
How can i change Primary Key Dublication message in My Form. when I Duplicate Primary key in form it show " The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. " How Can I change this message to My own Message?
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:44
Joined
Sep 21, 2011
Messages
7,732
You check for any errors with an error handler. Each error has it's own unique ID number.
You test for that and supply you own message.

However I would probably check if it exists before that with a DlookUp() and inform the user. Up to you though.

Error Handling
 

Bandara

Member
Local time
Today, 18:14
Joined
Apr 17, 2020
Messages
40
What i Want to do it when i entered and click submit if there is dubpliacte i want to pop up my own message in form
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:44
Joined
Sep 21, 2011
Messages
7,732
And I have just given you a link to show you how you could do it.? You need to start doing some research. Google can find you most things, then you can come back here and ask perhaps on how to modify the code.? That is how I learnt Access. At the moment it appears to me that you are really out of your depth here.? If you had tried that template, problems like this would have already been catered for.

If you do not want to do any of the work yourself, I am not going to even try to help you further in any other posts. Sorry.
 

Users who are viewing this thread

Top Bottom