There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
audio avg avg 8 bios boot browser bsod computer cpu crash css desktop driver dvd email error excel explorer firefox firefox 3 freeze game graphics hard drive hardware help please hijackthis hjt hjt log install internet internet explorer itunes javascript lan laptop malware missing monitor msn network networking openoffice outlook outlook 2003 outlook express php popups problem problems router seo slow sound sp3 spyware startup trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless word
Archive: Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications > Archive: Business Applications >
{SOLVED} Access 2000: Disallow Duplicate Records by All Fields


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
rkselby98's Avatar
Distinguished Member with 4,015 posts.
 
Join Date: May 2000
Location: Gettysburg, PA
Experience: Still Learning
11-Apr-2001, 04:03 AM #1
I have searched MS Office 2000 User Specialist Study Guide by SYBEX, Napier and Judd Comprehensice and to no avail not able to find an answer. Also searched MS Web for Access Help.

The problem is I am setting up a data base with names and addresses. I eant it to reject duplicate entries. I can set it so a field won't accept duplicates but I need to set it so the row of fields will not accept the entry if all fields are the same. If one of the fields is different I want it to accept the entry.

IE:

Name, Address, Phone
John, 1 Main, 555-555-1212
John, 2 Main, 555-555-1212
James, 1 Main, 555-555-1212
James, 1 Main, 212-555-1212

I realize the above is imposibe to have happen but this is just an example. The basics are the same.
__________________
Rick
http://rselby.net
General Help With MS Products
It is with the heart that one sees rightly; what is essential is invisible to the eye.
Antoine de Saint-Exupéry
RandyG's Avatar
Distinguished Member with 8,052 posts.
 
Join Date: Jun 2000
Location: American living in Dublin, Ireland
Experience: Advanced
11-Apr-2001, 04:59 AM #2
You can try http://www.access-programmers.co.uk/ for some assistance, or try to flag down YSB, who usually hangs out on the Development forum. Access is his forte!
Anne Troy's Avatar
Computer Specs
Administrator with 11,442 posts.
 
Join Date: Feb 1999
Location: Allentown, PA
Experience: Microsoft Word MVP
11-Apr-2001, 01:53 PM #3
Stay here, rk.
I order to do this properly, then, what you REALLY need to do is open up your table in design view.

Highlight ALL the fields. Click on the primary key toolbar button. There's a key on it (of course).
rkselby98's Avatar
Distinguished Member with 4,015 posts.
 
Join Date: May 2000
Location: Gettysburg, PA
Experience: Still Learning
11-Apr-2001, 02:01 PM #4
I'm still here. Thanks for the response.
THoey's Avatar
Distinguished Member with 3,432 posts.
 
Join Date: Feb 2001
Location: San Antonio, TX, USA
Experience: Format C:? Okay...
11-Apr-2001, 02:41 PM #5
Cool Dreammie1...
I thought you didn't know MS Access? That is the answer I would have given...

Good Call... ;-)
Anne Troy's Avatar
Computer Specs
Administrator with 11,442 posts.
 
Join Date: Feb 1999
Location: Allentown, PA
Experience: Microsoft Word MVP
11-Apr-2001, 02:45 PM #6
Cool Cool beans...
...coming from a master!
rkselby98's Avatar
Distinguished Member with 4,015 posts.
 
Join Date: May 2000
Location: Gettysburg, PA
Experience: Still Learning
11-Apr-2001, 05:23 PM #7
Sorry but that did not work. Maybe you didn't understand me. I want to be able to enter two records "ALMOST" identical but I do not want it to accept two records that "ARE IDENTICAL".

Thank both of you for your responses.

rkselby98's Avatar
Distinguished Member with 4,015 posts.
 
Join Date: May 2000
Location: Gettysburg, PA
Experience: Still Learning
11-Apr-2001, 05:38 PM #8
Sorry my mistake. I tried a new table any your way works great. Somewhere along the line I must have messed up the file I was working on because it didn't work with it.

I just decided to for the heck of it to try a newly created database and it works great.

OK found out what I did wrong. I had a field with auto number. When I changed that then the Unique Value worked on the table.

Thanks to both of you.

[Edited by rkselby98 on 04-11-2001 at 05:58 PM]
__________________
Rick
http://rselby.net
General Help With MS Products
It is with the heart that one sees rightly; what is essential is invisible to the eye.
Antoine de Saint-Exupéry
YSB's Avatar
YSB YSB is offline
Senior Member with 781 posts.
 
Join Date: Mar 1999
Location: New York City
19-Apr-2001, 04:14 PM #9
Sorry I missed this one.
I've been rather busy (,lazy, or both )and havn't had much time to log on.

Dreamboat, that is an interesting solution. While it should work, there is a better way to do the same thing without losing the benefit of the PK and autonumber field. Access can create a multi-field unique index that is not a PK. To do this, open your table in design view. Click on View|Indexes. In the Index Name column, give the index any name you like. In the properties on the bottom set Unique to Yes. Starting from that row, enter all fields you want to include in the index, one on a line. As long as you don't enter anything in the Index Name comlumn, all subsequent rows will be included in the index. Just leave out the Autonumber field and any other fields that you don't want checked. Usually the PK should be just the autonumber field which sets that field to be the unique identifier for each record in the table.

If the DB is very large though, this method could have some side effects. Specifically it could greatly increase the size of the DB and cost you some speed. In that case I would prefer a validation method of some sort instead of the index. If this works for you though, I won't confuse the situation with other ways to accomplish the same thing. I would just make the above change so that you can still can a normal PK in the table.

Good Luck!
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:12 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.