Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now