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 Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Report calculations
Kim Mittet 
    
4 years ago
Hi

I have a report with 2 columns and 100 record lines. I am trying to make a calculation in the footer section.
In column 1 i have 3 values - x,y,z, in column 2 i have different values. I want to make a calculation in the footer section, based on the values in column 2, but only for the values x and z in column 1.
All 100 records must be in the report since i also want to calculate the sum of all record and compare the 2 results.
Juan C Rivera  @Reply  
            
4 years ago
I am thinking of a function len() and a dim of 3 variables as  long, you may need to separate column 1 into the 3 variables and do the math that way.  this will take some VBA. L like to see a picture I'm having a hard time visualizing in my mind.
Kevin Robertson  @Reply  
          
4 years ago
If the calculation is based on the values in column 2 for the two values in column 1, what is the basis for including the values in the calculation? I agree with Juan, a screenshot of your report would be helpful.
A Glenn Yesner  @Reply  
     
4 years ago
Assuming values in column one are something like "Car", "House", "Farm" and values in column two are expenditures for each then probably use a Sum(IIF()) function. Have one for each of the three options and a total.
Kim Mittet OP  @Reply  
    
4 years ago
I think the answer from A Glenn Yesner is what i need, but i am not sure about the syntax.

The 3 values in column 1 (named "Transportmethod) : Car, Bike, Train
Values in column 2 is the cost of the transport metode in column 1 (named "Transportcosts")
I want to calculate the sum of all the costs for Car and Bike, but not Train, but i want the costs for train records to be displayed in the detail lines part of the record

Would the syntax be like : =sum(IIF(Transportmethod = Car or Transportmethod = Bike), Transportcosts)
A Glenn Yesner  @Reply  
     
4 years ago
Assume the table is tblTransportType, fields are Transportmethod and Transportcosts, record source for the report is the table (tblTransportType), group by the field Transportmethod and in the footer of the group put
=Sum(IIf([Transportmethod]="Car",[Transportcosts]))
Then modify it for each of the other groups (Bike, Train). Make sure you limit users that input the data to a list so "Car" is always "Car" and not "Auto" or "Toyota".
You can do it with queries and probably several other ways, this is the first that hit my mind.
A Glenn Yesner  @Reply  
     
4 years ago
Forgot to mention, make
=Sum(IIf([Transportmethod]="Car",[Transportcosts]))
the Control Source for a text box
Kim Mittet OP  @Reply  
    
4 years ago
A Glenn Yesner - thank you very much. Your proposed solution did it.

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

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: 9/21/2026 4:14:47 PM. PLT: 1s