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 
Frustrated by not being able to avoid duplicates
Cearbhall O'Meadhra 

11 years ago
After many weeks of reading, writing, downloading solution after solution I cannot get this database to work and prevent duplicates.

Here is the situation:
I am building a community database for our local advice centre. I have a table of services and agencies who provide services. These might be doctors, dentists, financial advice centres child care etc. I can have many agencies providing the same service (i.e. doctors) or I can have a single agency providing a range of services - not just one.

So, i have set up a services table, an agency table and a junction table to catch the foreign keys of each of the two primary tables.

I have then set up a form to access all the fields on the two primary tables and have defined the relationships between the primary keys and the junction table in the relationships section of access.

When I run the form I can update each table and the junction table is updated with the foreign keys to match the primary keys of each record but I cannot stop duplicates from occurring!

If I try to link an agency to a service that is already in the services table, a new record is created as if the service did not exist and a foreign key is assigned to it in the junction table and the service name is entered in the services table as if it were a new service.

Is there anyone who can explain what I should do?



Reply from Richard Rost:

I would recommend reviewing my lessons on Junction Tables and Many-to-Many Relationships first. I would build a form showing the Service as the parent record, and then select Agencies as the subform records; and then another form for the reverse relationship. The forms will automatically handle the relationships for you as long as you have it set up properly. It won't automatically prevent duplicates - you will still be able to enter the same service for the same agency twice - but you can prevent that by using a Composite Key in your junction table.

If you would like one of my Techs to take a look at your database file and figure out where you went wrong, then you can submit it via my TechHelp service.

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/16/2026 4:24:27 AM. PLT: 1s