Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Vehicle Maintenance < Cascading Combo Boxes | Relational Combo >
Back to Vehicle Maintenance    Comments List
Swapping SourceObject For SubF Upload Images   Link   Email  
Marc Spragg 
Hi,

I have a Mainform set up similar to the Extended Cut with the SourceObject switchable between two Subforms. Works perfectly. However, i am trying to get a value from a control in the subform to be present in the main form. I have a control that counts up the Detail (Counts amount of line items) in the subform. It works fine in the subform but for some reason i cannot get the value into the mainform. I've tried. The standard stuff - Forms! notation etc. Also tried putting the calculated field in the query used as the control source for the subform and Dlookup in the main form but nothing is working. Can anyone help?
Thanks Marc
Dan Jackson
Screenshots?
Marc Spragg

Marc Spragg

Marc Spragg

Marc Spragg
Thanks Dan. I've added some screenshots
Scott Axton
Marc -
If you go watch the video again you can see that the record source is determined by the SubForm that the button is making active.
If you are needing those values to look up from a specific SubForm you have to qualify the Subform in there.
Personally I would not use dLookup here.  I would just get the value directly from the SubForm

Referring to a subform takes a little bit different notation.
Forms!ParentFormName!SubformFormName.Form!FieldName

Access Developer 7  ( Lesson 1 )

Value From a Form  ( Extended Cut )

subform Bang! v Dot.   ( @timestamp 7:25 )
Marc Spragg
Hi Scott,
Sorry what do you mean by Qualify the subform?
I have the button making the SubForm active. I have re watched the video and the only thing i had different was the mainform source object was blank when loaded. I've change that now so the main form source object is the first subform.
I have put the notation you gave me above in the default value but it is still not working. Remains 0 even though the SubF field reads true with the count of line items.
Kevin Robertson
Kevin Robertson
Or try putting the notation Scott gave you in the Control Source for the field.
Marc Spragg
Thanks Kevin, putting it in the Control Source doesn't work. When you say on current event. How would you do that, with an if statement?
Marc Spragg
If i put a if statement into the on current event on the main form, the main form no longer opens in form view, only design view
Scott Axton
In computer programming, a fully qualified name is an "unambiguous name that specifies which object, function, or variable a call refers to without regard to the context of the call."
I other words if you are referring to a name on the form you are working in you just have to say
FieldName
If you are referring to a field in SubForm you have to tell Access the full path to that form thus the
Forms!ParentFormName!SubformFormName.Form!FieldName.



Kevin Robertson
I just set up a similar form with a field on the Parent form that gets its value from a calculated field on the Subform. I used the Control Source of the field (on the parent form). It worked perfectly so the Control Source is definitely the correct place.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Vehicle Maintenance.
 

 
 
 

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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/4/2024 6:08:22 AM. PLT: 0s