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 
Using Sum IIF
Brian Adams 
   
13 months ago
Hi Richard

This is my first time in contacting you for help with my Access Database.

I have an issue getting a calculation to work the way I need it to work and I'm not sure where I should be making this calculation i.e. in a query or in a textbox within a subform where some of the figures reside.

There are 3 tables in question where I have a query.

tbl2CustomerEnquiry, tbl3CustomerEstimate & tblMaterials.

The query (called qryCustEstMaterials has the following fields in this order - EstID from tbl3CustomerEstimate, SupplierID from tblMaterials, MaterialsID from tblMaterials, Invoiced (tickboc on a subform) from tbl3CustomerEstimate, Quantity from tbl3 CustomerEstimate, ListPrice from tblMaterials, ActualPrice from tbl3CustomerEstimate (this figure can change often), MatMkUp from tbl3CustomerEstimate (percentage for the markup).

I'm trying to make an extression or VBA in either the query or the subform textbox to "sum if" the ActualPrice has a cost in it by the Quantity (ActualPrice has a deafult set to '0') otherwise sum the ListPrice by the Quantity either/or with a name called 'SubCost'

I have tried the following sintax without success...

Sum(IIF([ActualPrice]=0, Sum([ListPrice]*[Quantity], [ActualPrice]*[Quantity])),0)

What am I doing wrong!?

Kind Regards

Brian Adams
Kevin Robertson  @Reply  
          
13 months ago
Not sure what your calculations are supposed to be but your IIF Function has too many arguments.

Example
    =IIF([ActualPrice]=0, 0, Sum([ListPrice])*Sum([Quantity]))

Please post some screenshots of some sample data.

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: 5/7/2026 9:18:10 AM. PLT: 1s