Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Developers    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Amt1 Field Update Problem
Werner Mildt 
       
85 minutes ago
Hi Richard,
I am having a problem with a different file with updating the Amt1 Field.
In my sample it starts out ok with the firth two records.
After that it does not work.
The sample will display the problem.
Is there a way in my code to make it work?
Every worked fine in my previous form!
Werner Mildt OP  @Reply  
       
84 minutes ago

Donald Blackwell  @Reply  
        
75 minutes ago
Hi Werner, your formula is working as it's entered. DMax finds the highest value in the table for that field. You have it looking for the highest value of any record where the id is less than the current one.

The first two work as you expect because -1260 is the first value and 255.17 is higher than -1260. It stays at 255.17 because that is the highest value until 1886 is entered then it stays there because no other higher values are entered.
Richard Rost  @Reply  
            
66 minutes ago
Hi Werner. Donald spotted it: DMax is finding the largest earlier Amount, not the Amount from the previous record. If by "previous" you mean the next lower AppendID, use DMax to find that ID first, then DLookup to get the Amount for that ID:

Amt1: Nz(DLookup("Amount","RecurrAccQ2","AppendID=" & Nz(DMax("AppendID","RecurrAccQ2","AppendID<" & [AppendID]),0)),0)

That handles gaps in AppendID, assuming the IDs are unique and positive. In your screenshot, AppendID 4 should then show -9.36 from AppendID 3, not 255.17. This follows AppendID order, not whatever sort order happens to be on the form. Thanks, Donald.
Werner Mildt OP  @Reply  
       
7 minutes ago
Thank you very much for your response, it works perfectly.
This really makes my day.
Thanks again
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

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: 12/2/2026 2:35:30 PM. PLT: 0s