Primary key warning messages

T

Terrence Carroll

I was wondering if it is possible to implement an error handling feature
where the user is alerted he is attempting to import duplcate values to a
primary key field while still haveing the warnings property set to NO. Any
advice on how to do this would be great.

Thanks,

Terry Carroll
 
W

Wayne-I-M

Hi

You could use the indexing in the table to disallow the additions.
Or
You could could use a simple popup message

But - - -
The idea of a primary field is that it can't/shouldn't allow duplicates - so
best to use the indexing feature in the table for this (eg. Allow duplicates
= No)
 
J

Jeff Boyce

Terrence

What is it that you are expecting the user to do if there is a duplicate key
situation? Access won't overwrite an existing key, so it seems like the
only reason to handle it is to let the user know there's something wrong.

Do you need to do that? Not a rhetorical question ... if you want to add
records to your table, but not add records that have a duplicate key, you
can do that without ever bothering the user.

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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