Solved

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

Posted on 2015-02-12
5
74 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
  • 3
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

828 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