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 
Send Control to a subform
Ina van Rooyen 

5 years ago
Hi guys
I have a main form "LittersF" with a subform "PuppyF". In the subform I have an option to select a buyer from a Combo Box "BuyerCombo".  I have a command button "AddBuyer" to create a new customer if it does not exist "BuyerF"
In the on click property event of "AddBuyer" I send the control, which is the BuyerID, from "BuyerF" to the Combo Box "BuyerCombo" in the subform "PuppyF". The "BuyerID" is not the control in the current subform. It does, however, have a relationships with the Puppy database
The idea is to have the name of the record that was created, in the combo box of the subform that is still open, when I close the "BuyerF" form.
It creates the record in the Buyer table but it does not send it to the subform.
I've tried a few options and hope someone can give me the magic answer.

This is the Row Source of the Combo Box "BuyerCombo"
SELECT BuyerQ.BuyerID, FullName FROM BuyerQ ORDER BY FullName;

This is my code:
Private Sub AddBuyer_Click()
    DoCmd.OpenForm "BuyerF", , , , acFormAdd
    Forms!LittersF!PuppyF!BuyerCombo = Me.BuyerID
    Me.Refresh
End Sub
Adam Schwanz  @Reply  
           
5 years ago
Subform syntax is forms!formname!subformname.form!fieldname   I think at least LOL always takes me a try or two to remember the right syntax
Scott Axton  @Reply  
        
5 years ago
This:
Value From a Form

See extended cut.
Adam Schwanz  @Reply  
           
5 years ago
Heyy I remembered it right for once LOL.
Scott Axton  @Reply  
        
5 years ago
I know right?  It only takes me forty-eleven tries to get some things.  Then all of the sudden it clicks and its off to the races like a herd of turtles,
Ina van Rooyen OP  @Reply  

5 years ago
Thank you, Adam.  I tried that syntax as well and I tried it again.  The new record is created in the table but the link is not created.  I have to close the LitterF form and open it again to see the new record from the combo box.  As soon as I close the BuyerF form and return to the subform I want to see the new record already selected in the combo box.

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 7:29:31 PM. PLT: 0s