Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Finding Duplicates
Greg Beben 
    
13 years ago
Brent, the way that I usually do this type of thing is to create an index which contains the fields which can't be duplicated. For example, if I have something like a social security number in the table, I will index that and set it to "unique". That way, if someone tries to enter another person with the same SS#, they'll get an error. You can also combine fields into an index. For example, make an index using the first and last names to make sure the same first and last name doesn't get entered twice. (Not always a good idea since people can have the same name.) But you can combine any fields which you need to be unique into an index and make it unique. The problem is that when the user tries to enter the person again, they'll get a cryptic message that they won't understand, but at least it won't let them enter the person twice. Perhaps Richard knows of a way to customize that error message? I just tell my users that if they see that message it means they're trying to put in a duplicate record.


Reply from Richard Rost:

I don't know of any way to customize that DUPLICATE VALUE IN INDEX message off-hand. There may be some crazy way to do it with VBA. If this is an issue, you can always perform a quick DLOOKUP to see if the record exists first, and then provide your own custom message before attempting to save the data.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/17/2026 4:44:27 AM. PLT: 1s