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 
Error Message From Unbound Main to Bound Subform
Alan Joseph Fealey 
     
7 months ago
How can I prevent an error message (3201) when I move from an unbound main form to bound sub form.

Both forms update the single table, after last information entered in main form, I press tab, I received error message, I click okay, and the cursor moves to the sub form.
Information updated from both main and sub form.

Thanks
Sami Shamma  @Reply  
             
7 months ago
John Davy  @Reply  
         
7 months ago
Hi Alan, Sami is correct. However; In Microsoft Access, Error 3201 typically occurs when a user attempts to add or change a record, but a related record is required in a linked table. This is a common data integrity issue, often triggered by a missing primary key or a foreign key constraint violation. For example, the error message "You cannot add or change a record because a related record is required in table '|'" indicates that a record cannot be saved in a child table without a corresponding record in the parent table.
This can happen during form operations, such as when trying to save a record in a parent form before adding related records in a subform.
Solutions involve ensuring the required parent record exists before attempting to save the child record, potentially using VBA code to save the parent record first.
John Davy  @Reply  
         
7 months ago
Check the subform properties to see how/if it is linked properly.  HTH John
Alan Joseph Fealey OP  @Reply  
     
7 months ago
Hi Sami and John
Thanks for your replies
I am setting up a Tyre Use Database

You take the tyre into tyrestock table. Primary Key = TyreID.
The tyre is fitted to the vehicle on the tyrefitment table. Foreign key = TyreID.

My Main Form is unbound, to enter kilometres and reason tyre was removed from vehicle (TyreFitment Table) No additions or deletions allowed on Main Form. Only changes to the record. (Update Query)
Record updates and are saved in the TyreFitment table.

When I pressed tab on last entry on Main Form. I receive Error message You cannot add or change a record because a related record is required in table 'TyreStock" Please note TyreID (primary key from TyreStock table) was selected from combo box in my Main Form
I press Okay.

I can then enter information onto my bound sub form, to enter new record in my tyrefitment table, Record updates and saves in table.

Please note both forms update and records are saved.

Thanks.

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: 4/30/2026 6:56:50 AM. PLT: 1s