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 > Forums > Access
Back to Access Forum    Comments List
Field calcs continuous forms Upload Images   Link   Email  
Michael Medici      
2 months ago
Hi all,

Running into a problem that should be relatively simple to fix..  I have a continuous form that allows me to add records at the bottom.  This form is to track overtime charges to the customer for various positions (many different rates).  The fields in question are 'laborrate' - that is the rate for the position, 'laborhours' the hours and 'totalcharge'.  As I add a record, the laborrate is autofilled based on information I add in (i.e. employee name, position, location, etc).  I manually add the laborhours and have a calculation on exit to populate totalcharge = labourhours*laborrate.  Well, it looks like regardless of the laborrate, the calculation is using the highest laborrate previously used.  Any clue how to make sure that the calculation only looks at the value within the current record?  Is this a me.recordset moment?
Sami Shamma             
2 months ago
Without seeing your code, when you say you autofill it from information, there is a chance that you are still on a dirty record and your calculation is reading it from the last record that was saved. This is just an educated guess. Please share how you do your rate calculation.
Michael Medici      
2 months ago
I am using several fields in the new record that I fill out and using dlookups to other tables.  It is a little complex as I threw it together to get reports out to our customer and I will look to streamline it in version 2.  The record does populate the correct laborrate for that position it is just the final calculation of the totalrate that is not right.

[ratecombo] = [ChargeType] & "-" & [EmpPosition] & "-" & [EmpSiteCode]
    If Not IsNull([EmpSiteCode]) Then
        'Populate Location, Local and Region
        [EmpSite] = DLookup("location", "qryotsitecodes", "rsitecode=empsitecode")
        [EmpLocal] = DLookup("localregion", "qryotsitecodes", "rsitecode=empsitecode")
        [EmpRegion] = DLookup("Region", "qryotsitecodes", "rsitecode=empsitecode")
        [ratecombo] = [ChargeType] & "-" & [EmpPosition] & "-" & [EmpSiteCode]
        
        'Populate Rate
        If [ChargeType] <> "Expenses" Then
           [LaborRate] = DLookup("otrate", "qryotrates", "ratecombo=" & "'" & ratecombo & "'")
           [LaborCurr] = DLookup("currency", "qryotrates", "ratecombo=" & "'" & ratecombo & "'")
        ElseIf [ChargeType] = "Expenses" Then
            [LaborRate] = 0
            [LaborRate].Locked = True
            [LaborHours] = 0
            [LaborHours].Locked = True
            DoCmd.GoToControl "totalcharge"
        End If
Sami Shamma             
2 months ago
Throw in.

Me.refresh

Before your calculations.

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

 
 
 

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: 4/15/2024 9:50:28 AM. PLT: 1s
xxx