Solved

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

Posted on 2015-02-12
5
76 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

738 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