Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Seminars   Templates   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Parent Record < Available Credit | ChatGPT VBA Code >
Parent Record
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   6 months ago

Adding a Parent Record if None Exists in Access


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial I will show you how to automatically add a parent record if the user tries to add a child record in a subform first thus preventing an orphan. We will automatically add an order record if the user starts adding an order detail record and the order doesn't exist yet. We will then set up Referential Integrity to prevent future orphan records if the user deletes the order.

Pre-Requisites

Links

Recommended Courses

Updated Template

Source Code

' In the OrderDetailF subform:
Private Sub Form_BeforeInsert(Cancel As Integer)
    If IsNull(Parent!OrderID) Then
        Parent!OrderDate = Date
        Parent.Refresh
    End If
End Sub

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

KeywordsCreating a Parent Record in Microsoft Access

access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, automatically add parent record, Check if Record Exists if not add it, Adding parent records, Preventing orphan records, Automatically adding parent records, Referential Integrity, prevent deletion

 

 

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Parent Record
Get notifications when this page is updated
 
 
 
 

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
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 2023 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/29/2023 5:49:42 AM.
Keywords: FastTips Access Fast Tips automatically add parent record, Check if Record Exists if not add it, Adding parent records, Preventing orphan records, Automatically adding parent records, Referential Integrity, prevent deletion  PermaLink  Creating a Parent Record in Microsoft Access