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 
Query Problem
Hezi Cohen 
    
4 years ago
Hi
In my database I'm using 3 tables as follow:
PoductsT, ManufacturersT, SuppliersT
In the ProductsT I use ProductID as primary key
while in the other 2 tables I used it as a foreign key.
I bound the tables in one to many relationship
then try to combine all of then in one query, I can see the records but can't do any changes or add new records.
is there any solution to this problem?

Kevin Robertson  @Reply  
          
4 years ago
I wouldn't store the ProductID in the other 2 tables. Instead create a couple of junction tables. See Many-to-Many on how to set this up.
Kevin Yip  @Reply  
     
4 years ago
Hi Hezi, a query is non-updateable when the join fields are not primary keys.  ProductT and ManufacturersT are joined by ProductID.  While ProductID is a primary key for ProductT, it is not a primary key for ManufacturersT.  And that is why your query is not updateable.  This is one of the less obvious reasons why some queries are non-updateable.

To solve your problem, you need queries that join primary key fields in order for them to be updateable.

For instance, you may have a ManufacturerProductsT table that contains a list of products for a manufacturer.  This is the kind of junction table Kevin referred to above.  In this case, it is a "child table" for the ManufacturersT table.  It may contain three fields: ManufacturerID, line_number, ProductID -- with the primary key being ManufacturerID and line_number.  Then you join ManufacturersT to ManufacturerProductsT.  The join field will be ManufacturerID, which is a primary key.  And that's how you make this query editable.

The best way to update info is with forms, of course.  For instance, you may want to update ProductID with a combo box lookup on a form, instead of manually typing a product ID into a query.

Hezi Cohen OP  @Reply  
    
4 years ago
Thank you ALL for the very interesting solutions.
I need to learn more a bout the many to many relationships and see how its goes.
best regards
hezi

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: 6/16/2026 11:22:38 AM. PLT: 1s