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 > Courses > Access > Developer > D08 > < D07 | D09 >
Back to Access Developer 8    Comments List
Upload Images   Link   Email  
Lesson 2 Question
Lesli Cochran 
   
3 years ago
Hi,

I have spent days trying to figure out why the INVOICE TOTAL only loads on my PaymentF (linked by button on OrderF) some of the time. I have discovered, when I click in OrderDetail (Subform of OrderF BEFORE clicking the Payment Button (on OrderF), the PaymentF INVOICE TOTAL loads correctly.

Is there a way in the code to fix this? I'll post images as well.

Thank you!
Lesli Cochran OP 
   
3 years ago

Lesli Cochran OP 
   
3 years ago

Kevin Robertson 
          
3 years ago
Try adding a Me.Refresh to the button code before the command to open PaymentF.
Lesli Cochran OP 
   
3 years ago
Hi,

After adding me.refresh to button VBA: Clicking button opens form with $0 - Invoice Total
After clicking to enter a payment amount the Invoice Total appears - until I move to payment method and Invoice Total is $0 again.
Lesli Cochran OP 
   
3 years ago

The payment form has:

On Current, After Update,
  Me.Refresh
   Forms!OrderF.Refresh

The OrderF will actually populate the correct amount paid and due.



Kevin Robertson 
          
3 years ago
How did you get the amount in the Invoice Total Text Box on the Payment Form?
In the Control Source, is it something similar to this:
=[Forms]![OrderF]![OrderDetailF].[Form]![SumLineTotal]
Lesli Cochran OP 
   
3 years ago
Yes
Lesli Cochran OP 
   
3 years ago
I've gotten to the point that it will populate the Invoice Total while Payment detail recored is Dirty, but after update the value goes back to zero.

The form is refreshed AfterUpdate, FormCurrent,

Kevin Robertson 
          
3 years ago
Can you post a screenshot of the Payment form in Design View?
Lesli Cochran OP 
   
3 years ago

Lesli Cochran OP 
   
3 years ago
Invoice Total Control Source =[Forms]![OrderF]![OrderDetailF].[Form]![GrandTotal]
Total Payments Control Source =Sum([PaymentAmount])
Amount Due Control Source =[InvoiceTotal]-[PaymentTotal]
Lesli Cochran OP 
   
3 years ago
The code checks and refreshes the OrderF multiple times. Will this disengage the OrderDetailF which is a subform of OrderF. I feel like the problem lies in the refresh code.
Lesli Cochran OP 
   
3 years ago
Or...should I create a Query with PaymentT and OrderDetailT for the control source of PaymentF.  Maybe it's just too much calculations going on? On the OrderDetailF, the GrandTotal control source = =([SubTotal]+[TotalServiceCharge]+[TotalServiceChargeTax]+[TotalSalesTax]+[TotalAlcoholTax])

Kevin Robertson 
          
3 years ago
Really shouldn't make a difference as the GrandTotal has already been calculated when you click the button - but certainly give the query a try. Sometimes you have to go with whatever solution works best.

I've been trying to replicate your issue and so far, nothing I've tried has made the field behave that way. Guess it's a lot harder to break it when you actually want to. LOL
Lesli Cochran OP 
   
3 years ago
I basically cut out all the coded refreshing. The Invoice Total calculates when I enter a Payment Amount and everything from there calculates and performs as expected so I think I'll take this as good enough! Thank you for your responses :)

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

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/27/2025 7:42:46 AM. PLT: 2s