PC Review


Reply
Thread Tools Rate Thread

Warning when add new record with duplicate primary key

 
 
Song
Guest
Posts: n/a
 
      10th Jul 2006
I have a form to add new record using navigation button at the bottom. When
fill in all the fields, Access would give a nasty warning message when stID
(primary key) is already exist.

I need code that when user enters duplicate value in stID (which is the
first control on the form), it would be notified such stID already exist and
would locate the existig record and display on the form.





 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      10th Jul 2006
Check this link on "Preventing Duplicates from being entered"

http://www.databasedev.co.uk/duplicates.html

--
Good Luck
BS"D


"Song" wrote:

> I have a form to add new record using navigation button at the bottom. When
> fill in all the fields, Access would give a nasty warning message when stID
> (primary key) is already exist.
>
> I need code that when user enters duplicate value in stID (which is the
> first control on the form), it would be notified such stID already exist and
> would locate the existig record and display on the form.
>
>
>
>
>
>

 
Reply With Quote
 
 
 
 
Song
Guest
Posts: n/a
 
      10th Jul 2006
It works great! Thanks.

"Ofer Cohen" <(E-Mail Removed)> wrote in message
news:A39FC2AC-1714-40A1-A4FD-(E-Mail Removed)...
> Check this link on "Preventing Duplicates from being entered"
>
> http://www.databasedev.co.uk/duplicates.html
>
> --
> Good Luck
> BS"D
>
>
> "Song" wrote:
>
>> I have a form to add new record using navigation button at the bottom.
>> When
>> fill in all the fields, Access would give a nasty warning message when
>> stID
>> (primary key) is already exist.
>>
>> I need code that when user enters duplicate value in stID (which is the
>> first control on the form), it would be notified such stID already exist
>> and
>> would locate the existig record and display on the form.
>>
>>
>>
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do I have to set the primary key to include primary key fields? boooney Microsoft Access Database Table Design 3 15th Apr 2010 12:17 AM
Data Primary key vs. Artificial (Autonumber) primary key M. Microsoft Access Database Table Design 78 14th Dec 2007 10:10 AM
To add a new record by copying from another record then change the primary key SF Microsoft Access Forms 5 10th Aug 2004 02:13 PM
calculating primary key programmatically in add new record button =?Utf-8?B?ZHJldw==?= Microsoft Access Form Coding 1 19th Jun 2004 11:12 PM
Cannot add primary key constraint since primary key is already set for the table Microsoft VB .NET 1 3rd Dec 2003 02:14 AM


Features
 

Advertising
 

Newsgroups
 


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