A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Primary key warning messages



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 10:16 PM posted to microsoft.public.access
Terrence Carroll
external usenet poster
 
Posts: 37
Default Primary key warning messages

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
  #2  
Old May 27th, 2010, 10:31 PM posted to microsoft.public.access
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Primary key warning messages

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)


--
Wayne
Manchester, England.



"Terrence Carroll" wrote:

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

  #3  
Old May 27th, 2010, 10:31 PM posted to microsoft.public.access
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Primary key warning messages

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.

"Terrence Carroll" wrote in
message ...
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.