Solved

Access Textbox to show a total of a column of certain records

Posted on 2013-11-04
5
1,108 Views
Last Modified: 2013-11-04
I would like to fill in a text box on a form with a query of something like this.  It will keep a tally of the data filled in with the records on the page.  I will have the tally refreshes after a record is updated or added within the form.

SELECT DISTINCTROW Sum([tblTABLE].[COLUMN]) AS [Sum Of COLUMN]
FROM tblTABLE
WHERE (((tblTABLE.ID)=[ID]));

I have this query working in a query.  But I wanted the form to perform a query such as this but limit the sum math to the records that match the ID from a part of the form.

I got this to work as well but this adds all columns in the table, again I only want a sum of records that match a criteria (ID from a place on the form).  =Sum([tblTABLE]![COLUMN])

Help please!  Thank you
0
Comment
Question by:getwidth28
[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 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39622003
Try this:
= DSum("[Column]", "[Table]", "[ID] = " & [IDFromForm])
0
 

Author Comment

by:getwidth28
ID: 39622017
Right on man!  That done it looks like. Thank you
0
 

Author Comment

by:getwidth28
ID: 39622024
I've requested that this question be closed as follows:

Accepted answer: 0 points for getwidth28's comment #a39622017

for the following reason:

Quick and easy.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39622021
Whoops!  Try closing the question again.  It looks like you marked your own comment as the solution.  You might need to post a comment using the Object Button for the normal closing buttons to appear.
0
 

Author Closing Comment

by:getwidth28
ID: 39622025
Great to work with.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

695 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