Computer Learning Zone CLZ Access Excel Word Windows

Avoidable human misery is more often caused not so much by stupidity as by ignorance, particularly our ignorance about ourselves.

-Carl Sagan
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to TechHelp    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Copying A Field
Richard Van Wagoner 
      
4 years ago
I am trying to copy the math result off of a subform to the parent form. I can't seem to just copy it. Maybe you could point me in the right direction. I am on Expert level 14 lesson 3 with my courses. If this is covered in future lessons could you tell me which one?
Kevin Robertson  @Reply  
          
4 years ago
What have you tried to copy the value?
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
I tried Forms![ProductTotal]! procedure. I have tried Dlookup.
Kevin Robertson  @Reply  
          
4 years ago
In the Control Source of the field on the Parent form use this syntax:
=[SubformName]![FieldName]

Example:
=[OrderDetailF]![SumExtPrice]
Richard Van Wagoner OP  @Reply  
      
4 years ago
That is just what I wanted! Thank you!
Kevin Robertson  @Reply  
          
4 years ago
You're welcome.
Richard Van Wagoner OP  @Reply  
      
4 years ago
Just one more question on this subject. I am generating a report on this form. I can't seem to move that field to my report and make it work. Any suggestions? By the way, I'll tip you as soon as I am set up on Paypal.
Richard Van Wagoner OP  @Reply  
      
4 years ago
I was checking it is not putting the value in the table.
Kevin Robertson  @Reply  
          
4 years ago
Sorry. I didn't realise you were storing the value.
You could do something like this in the On Current Event of the parent form:

If Not IsNull(OrderID) Then
    OrderTotal = OrderDetailF.Form!SumExtPrice
    Me.Refresh
End If


Value From a Form
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
I must not have things right.Is this supposed to be on the Parent form event  ON Current Tab?
Richard Van Wagoner OP  @Reply  
      
4 years ago
Parent Form is Named ProductF. Subform is ProductDetailF. And the total in subform is SupplySum.
Kevin Robertson  @Reply  
          
4 years ago
The code needs to go in the OnCurrent EVENT of the Parent form.
Open the Property Sheet for the Form and go to the Event tab.
Click on the Builder button (see screenshot).
Kevin Robertson  @Reply  
          
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
I am sorry to keep bothering you. But that is where I put it. Do I have my forms named right in the event?
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
This is the error message I get when opening the product form.
Kevin Robertson  @Reply  
          
4 years ago
Remove the code from there and click on the builder button (...) at the right. If you get the Choose Builder dialog, choose 'Code Builder' to open the Visual Basic Code Editor. This is where you need to enter the code.

Did you watch the On Current Event video?
Also: Intro to VBA.
Richard Van Wagoner OP  @Reply  
      
4 years ago
I haven't got that far into the lessons. Is the builder button on Parent form properties?
Kevin Robertson  @Reply  
          
4 years ago
Yes. See the screenshot I posted above. With the red square.
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
This is the error message I get now when opening the parent Form. I have also included a screen shot of where I put the code.
Kevin Robertson  @Reply  
          
4 years ago
That's the Expression Builder. You need the Code Builder.
Kevin Robertson  @Reply  
          
4 years ago

Kevin Robertson  @Reply  
          
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
I am not getting the chance to Choose the Builder That option is not displaying for me. I am clicking on the 3 dot on the right but all that comes up is the expression builder.
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
Is this the right place?
Kevin Robertson  @Reply  
          
4 years ago
Did you remove all the code you entered previously?
Kevin Robertson  @Reply  
          
4 years ago
Yes. Now enter the code between the Private Sub and End Sub.
Richard Van Wagoner OP  @Reply  
      
4 years ago
Yes, I removed it. Now I will put it in the right place. I have bothered you enough tonight, whether this works or not I will leave it as is till another day. Thank you so much!
Scott Axton  @Reply  
        
4 years ago
Richard  -
In the picture I'm looking at it appears that you are trying to put your code directly into the property sheet instead of the code module associated with the form you are working with.
That is the reason you are getting the error.

So...
Try this:
1. Copy that code in the zoom box and paste it into Note Pad to save it temporarily.  Close the Zoom Box.
2. Now click in the blank "cell" to the right of On Load.  Press the Up Arrow on your keyboard once.  It should highlight the contents in the on On Current line.  Press the Delete key.
3. Now that we are sure that everything is out of the On Current, you should be able to click the   ...   button and it should bring up the Choose Builder dialog box.  Click Code Builder then click OK.

Follow Kevin's instructions from there using the code you pasted in the Note Pad.
Richard Van Wagoner OP  @Reply  
      
4 years ago
I tried what you said and still an error. see images.
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago

Kevin Robertson  @Reply  
          
4 years ago
Check the name of your Subform object.
Richard Van Wagoner OP  @Reply  
      
4 years ago
Here is a screenshot of what I have
Richard Van Wagoner OP  @Reply  
      
4 years ago

Richard Van Wagoner OP  @Reply  
      
4 years ago
I saw one problem with SubformID, so I changed it. Now I get this error message. I did watch the Intro to VBA video last night and the extended cut video. I have a little better understanding of what is going on now.
Richard Van Wagoner OP  @Reply  
      
4 years ago

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

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:32:28 PM. PLT: 1s