• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1477
  • Last Modified:

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

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
getwidth28
Asked:
getwidth28
  • 3
  • 2
1 Solution
 
mbizupCommented:
Try this:
= DSum("[Column]", "[Table]", "[ID] = " & [IDFromForm])
0
 
getwidth28Author Commented:
Right on man!  That done it looks like. Thank you
0
 
getwidth28Author Commented:
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
 
mbizupCommented:
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
 
getwidth28Author Commented:
Great to work with.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now