Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Form Footer Totals    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Footer totals not adding
Holly Lindsey 
    
2 years ago
I just added the barcode scanning into my database, and my footer totals on my parent form are not refreshing correctly when I scan the same item and it increments the qty on sub form.
Alex Hedley  @Reply  
           
2 years ago
Is the Total in the Sub Form Footer or the Parent Form Footer?
Holly Lindsey OP  @Reply  
    
2 years ago
It is in both but not visible on the sub form footer.
Holly Lindsey OP  @Reply  
    
2 years ago
The totals on the parent form are being saved to the order table.
Holly Lindsey OP  @Reply  
    
2 years ago

Alex Hedley  @Reply  
           
2 years ago
How are you letting Parent Form know that the SubForm has been updated?
Holly Lindsey OP  @Reply  
    
2 years ago

Holly Lindsey OP  @Reply  
    
2 years ago
The totals refresh fine when changing the quantity manually.
Holly Lindsey OP  @Reply  
    
2 years ago
I've also tried me.parent.requery and me.parent.refresh in the after update for the subform and it still doesn't refresh unless I go in manually and change the quantity.
Alex Hedley  @Reply  
           
2 years ago
What does the barcode scanning do?
Which field does it change?
Holly Lindsey OP  @Reply  
    
2 years ago
When I scan an item it adds it to the order and refreshes both the sub form and parent form footer totals, but when I scan the same item again it updates the quantity and refreshes the sub form footer totals but the parent form footer totals do not refresh. I even clicked the refresh button and it still doesn't refresh the totals in the parent form. Attached is the form with the 2 different totals after scanning the same item 2 times. Also attached it the code I used for the barcodes scanning to increment the quantity.
Holly Lindsey OP  @Reply  
    
2 years ago

Holly Lindsey OP  @Reply  
    
2 years ago

Kevin Yip  @Reply  
     
2 years ago
Instead of using VBA code to update the parent form's totals, use references of the subform controls containing the totals instead.  In each of the parent form's total textboxes, go to Properties -> Control source, enter something like this:

     =[Put subform's name here].[Form]![Put subform's total textbox name here]

This way, the parent's textboxes will always show the subform's textboxes' values, always.  No refreshing is needed, because this is a *direct reference* that will always show the value the reference is pointing to.

The reason AfterUpdate only works when you enter data manually is because that is exactly how AfterUpdate works.  If you use code to change form data, Access doesn't see that as an "update" and won't run AfterUpdate.  This is what Microsoft's documentation ( https://learn.microsoft.com/en-us/office/vba/api/access.form.afterupdate-event ) says: "Changing data in a control by using Visual Basic or a macro ... doesn't trigger these events..."
Holly Lindsey OP  @Reply  
    
2 years ago
Thank Kevin, I had that in the totals control box prior, but took it out so I could save it to my table. It does work but know my totals are not saved to the order table.
Kevin Yip  @Reply  
     
2 years ago
Maybe you don't need to save the totals.  Totals are going to be changed all the time, so it doesn't make sense to have to save them every time.  The general rule of thumb is that anything that needs to be calculated shouldn't be saved to a table -- they need to be obtained via calculations instead (in queries, calculated fields, etc.).

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

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: 4/12/2026 9:56:25 PM. PLT: 0s