How do I sum values to an unbound field

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

Guest

Hello,

I have two tables:
Accounts (Fields: Accound ID, Account Name)
Account Transactions (Fields: TranID, AccountID, TranDate, TranAmount)

I have a form that displays all my accounts from the Accounts Table.

In the above form I would like to also include an unbound field that TOTALS
the TranAmount from the Account Transactions Table.

How can I do it?
 
Hi Meirav,

In design view, you can type the following directly into your unbound field:

=DSum("TranAmount", "Account Transactions")
 
WOW! That definatly took me farther BUT :) my form has more than one
accounts, and what happens is that it shows the sum of ALL the transactions
in ALL the accounts. Not just for the specifit account.

My form is a tabular one (multi occr):
Account ID , Account Name , Total Account

I looked in to the DSum function and there is a criteria place so I just
added:
=DSum("TranAmount", "Account Transactions","Account ID")
But it still did not work...

Help :(
 
I got to thinking about that, then got called away to a meeting :)

Perhaps this will help (presuming your form name for accountingID is the
same as the table name) :

=DSum("TranAmount", "Account Transactions","[AccountID] = Me![AccountID]")
 
BINGO!

Thank You! Thank You! Thank You! Thank You! Thank You! Thank You!

Gwhit said:
I got to thinking about that, then got called away to a meeting :)

Perhaps this will help (presuming your form name for accountingID is the
same as the table name) :

=DSum("TranAmount", "Account Transactions","[AccountID] = Me![AccountID]")



Meirav said:
WOW! That definatly took me farther BUT :) my form has more than one
accounts, and what happens is that it shows the sum of ALL the transactions
in ALL the accounts. Not just for the specifit account.

My form is a tabular one (multi occr):
Account ID , Account Name , Total Account

I looked in to the DSum function and there is a criteria place so I just
added:
=DSum("TranAmount", "Account Transactions","Account ID")
But it still did not work...

Help :(
 
Back
Top