Solved

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

Posted on 2013-11-04
5
969 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

790 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