PC Review


Reply
Thread Tools Rate Thread

avoid duplicate record.

 
 
Anton Ayrapetov
Guest
Posts: n/a
 
      22nd Dec 2009
I have a club members database. The member table includes member's
Last Name and First name. I need to prevent multiple entry of the
member but still allow entry for persons having same last name. for
instance:
first record
Last Name: Smith
First Name: John
If clerk enters Smith John again, it should give him an error
Message something like : " Smith, John already exists in the database
"
However, if Smith Rebeca joins the club, there should be no problem to
put the record.
How to make the entry checked against two fields , and prompt for the
error only if both fields match the new entry?

thanks
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      22nd Dec 2009
One way to prevent this is to use a unique index built on the two fields.

To create a multiple field unique index (Compound index)
--Open up the table in design mode
--Select View: Index from the menu
--Enter a name for the iIndex in first row under Index Name
--Select one field in the index under Field Name
--Set Unique to Yes
--Move down one line and select the next FieldName
(Do NOT skip rows, do NOT enter the index name again)
--Continue moving down and selecting fieldnames until all needed fields are
included.
--Close the index window and close and save the table


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Anton Ayrapetov wrote:
> I have a club members database. The member table includes member's
> Last Name and First name. I need to prevent multiple entry of the
> member but still allow entry for persons having same last name. for
> instance:
> first record
> Last Name: Smith
> First Name: John
> If clerk enters Smith John again, it should give him an error
> Message something like : " Smith, John already exists in the database
> "
> However, if Smith Rebeca joins the club, there should be no problem to
> put the record.
> How to make the entry checked against two fields , and prompt for the
> error only if both fields match the new entry?
>
> thanks

 
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
Avoid inserting a duplicate record on page submit? planetthoughtful Microsoft C# .NET 6 30th May 2006 07:38 AM
Avoid Duplicate Record JoeCL Microsoft Access Forms 3 4th Jun 2004 09:12 PM
Avoid duplicate entries Chris Nebinger Microsoft Access VBA Modules 1 2nd Jun 2004 06:55 PM
Avoid Creating A Duplicate Record Mark Microsoft Access Getting Started 4 11th May 2004 01:52 AM
Avoid Creating A Duplicate Record Mark Microsoft Access Form Coding 4 11th May 2004 01:52 AM


Features
 

Advertising
 

Newsgroups
 


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