Modify standard warning text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there any way I can modify the text of the standard message that comes back when a duplicate primary key is about to be made:

"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key or relationship........"

This is not user friendly and I'd like to make the message more specific to my application to provide better guidance to the end user. Any help is appreciated.

Thanks,
Jody
 
Jody

One approach might be to add code to your form's control that holds the key.
In the BeforeUpdate event, you could query the underlying data to see if the
user has entered an already-existing key value, and warn & prevent that.

Out of curiosity, what are you using for a primary key, that forces the user
to enter one "blind", hoping not to duplicate another already in? And what
do you want the user to do, if s/he tries to create a primary key (I assume
according to some pattern/rule) that s/he cannot use, because another
already exists?

What comes to my mind is something like the following:

"Use the Initial of the FirstName and the first 5 characters of the LastName
as a 'primary key'"

(but this will have problems with:)

John Smith
Jane Smithson
Jeff Smithers
Judy Smithe

not to mention

Jim Smit

Good luck!

Jeff Boyce
<Access MVP>
 
Jeff,

The primary key is a composite - entrantID, Date and Session. The same entrant cannot be enrolled on a duplicate date and session.

I'll give your ideas a try.

Thanks,
Jody
 
Back
Top