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 
Code for Opening ContactF
Roger Strate 
       
7 months ago
In OnClick this is the code: Private Sub OpenContactBtn_Click()

    DoCmd.OpenForm "ContactF", , , "MinisterID=" & MinisterID

End Sub

In InsertInto this is the code

Private Sub InsertIntoBtn_Click()
    
        CurrentDb.Execute "INSERT INTO ContactT (MinisterID, Description) " & _
        "VALUES (" & MinisterID & ", """ & Notes & """)"
            
    Notes = Null
    Me.Refresh


End Sub
Donald Blackwell  @Reply  
        
7 months ago
I think you just need to add the FamilyID field in your SQL statement and add the value of the familyID from the subform. If I read it right, I think your sub should look something like:

Private Sub InsertIntoBtn_Click()
    
        CurrentDb.Execute "INSERT INTO ContactT (MinisterID, Description, FamilyID) " & _
        "VALUES (" & MinisterID & ", """ & Notes & """, " & FamilyHeadF.Form!FamilyID & ")"
            
    Notes = Null
    Me.Refresh

End Sub
Donald Blackwell  @Reply  
        
7 months ago
However, if I misinterpretted, replace FamilyHeadF with the name of your subform control.
Roger Strate OP  @Reply  
       
7 months ago
Donald you are absolutely awesome and I am very impressed. I have been working on this for weeks and even consulted ChatGPT several times and your solution is the only one that works. Thank you so much, I am in awe of your skills again.
Donald Blackwell  @Reply  
        
7 months ago
Always happy to help.

If you need to work with subform values again, don't forget about Richard's Value From Subform video if you run into any more snags.
Roger Strate OP  @Reply  
       
7 months ago
Good advice, thank you Donald I will remember that.

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/7/2026 6:31:09 AM. PLT: 0s