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 
Continuous Forms Calc not work
Michael Medici 
     
2 years ago
All,

I have a continuous forms with all bound fields.  There is a rate field, Qty field and total charge field.  Depending on the item, the rate will be different and, of course, the qty will be different.  I do all entry from the continuous forms and have the calculate for the Total Charge done after exiting the qty field.  The form is using the first rate of the first record in the list instead of the rate for the specific record I am in to do the calculation, even though the rate field for that record shows correct.  Any thoughts?

Thanks
Sami Shamma  @Reply  
             
2 years ago
Show your calculations.
Adam Schwanz  @Reply  
           
2 years ago
Yea upload a picture, probably an issue with where the fields are placed (just guessing it's in the footer) and what the fields are bound to/calculations
Michael Medici OP  @Reply  
     
2 years ago
Ok, in my explanation I simplified it as I didn't think it would matter.  The actual field names involved are;
Laborhours (this will be the number of hours)
AVSRate this is the base rate
AVSTotal this is the total rate (labourhours * AVSRate)

One other item, there is a charge type, depending on the charge type will change the calculation as:
Expenses - no calculation, copy the avsrate to avstotal
Surge - multiply avsrate by laborhours
OT - multiply avsrate by 1.5 (to account for OT rate) then multiply by laborhours.  

Here is the code:

Private Sub AVSRate_Exit(Cancel As Integer)
If ([ChargeType] = "Expenses") Then
    [AVSTotal] = [AVSRate]
ElseIf ([ChargeType] = "Surge") Then
    [AVSTotal] = [AVSRate] + [LaborHours]
ElseIf ([ChargeType] = "OT") Then
        [AVSTotal] = ([AVSRate] * 1.5) * [LaborHours]
End If
End Sub

Michael Medici OP  @Reply  
     
2 years ago

Richard Rost  @Reply  
          
2 years ago
First bit of advice: use AfterUpdate, not OnExit. Aside from that, your calculations look fine.
Michael Medici OP  @Reply  
     
2 years ago
I'll try the afterupdate, but I feel I had done that before with the same result.  It is taking the first record's AVSRate and using that for all the records, making the AVSTotal incorrect.
Richard Rost  @Reply  
          
2 years ago
Make sure all your controls are properly bound to a field in the current record.
Michael Medici OP  @Reply  
     
2 years ago
They all are.
Sami Shamma  @Reply  
             
2 years ago
Also, make sure that they field record source is the same as the field name
Paul Kiener  @Reply  
      
2 years ago
The code for "Surge" does not match your description as to what it means.  Code:   [AVSTotal] = [AVSRate] + [LaborHours]; your description:  Surge - multiply avsrate by laborhours.

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/17/2026 5:16:01 AM. PLT: 1s