Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to base the sum of a control on the state of another control (checkbox)

Posted on 2015-02-12
5
Medium Priority
?
84 Views
Last Modified: 2015-02-12
I have a subform for which I am summing one of the controls, using the simple expression =Sum([LineTotal])

I would like that sum to only include the records for which a checkbox control is "true", but I'm not certain how to modify my expression to accomplish this. (see attachment)

Thank you in advance.clip.jpg
0
Comment
Question by:Shooter54
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 40606545
=Sum(IIF([CheckBoxFieldName],[LineTotal],0))

Ron
0
 

Author Comment

by:Shooter54
ID: 40606578
Perfect! Thank you very much.
0
 

Author Comment

by:Shooter54
ID: 40606822
I've requested that this question be closed as follows:

Accepted answer: 0 points for Shooter54's comment #a40606578

for the following reason:

Simple and concise solution to what to me was a difficult problem.
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 40606608
Looks like you inadvertently selected your own comment as the answer.  I suggest you click on Request Attention at the top (right after your question) to someone fix this.
0
 

Author Comment

by:Shooter54
ID: 40606823
I inadvertently accepted my own response as the solution. (sorry, new user) IrogSinta, ID 40606608 provided me the solution. Please resolve.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question