Sum fields in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey

I have a table A and a table B with different records and one field ID
linking B to A.
Then I have a Form with some controls and the forms record source is linked
to table A. One of the controls in the form is a textbox.
The user is allowed to insert records into table B, and therefore I want to
view the results in the textbox.
In this example, I want to sum the deposits the user makes.

In SQL language:

SELECT deposit FROM B WHERE B.ID = A.ID
....and then sum the result.

But I want this to happen in a textbox, and as far as I know, I can't insert
SQL Selects into the control source of a textbox. Is it possible to use the
Expression Builder to calculate this sum of the records in B, where B.ID =
A.ID?

Hope this example is not too confusing ;-)
 
More information needed. What is the purpose of table A and table B? What
is the field linking them together? If you have a form with table A as its
records source, what do you mean when you say the user is allowed to insert
records in table B? How do they do that? You will need to provide the
outline at least of your database design.
 
Back
Top