Consulting

Results 1 to 2 of 2

Thread: calculated field

  1. #1

    calculated field

    hey
    i have 2 tables : big one - deals table , and small one - bookkeeping .
    every deal has many records of bookkeeping .
    in the bookkeeping table , i have this fields : date , credit , debit and balance.
    i want that in the form , the balance will take the former balance+credit-debit
    how can i do this thing in a simple way ?

  2. #2
    VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    You don't actually incorporate the "Balance" field in the calculation - in fact you don't really need a "Balance" field at all, as your forms and reports can use this calculation to obtain the balance.

    [vba]=IIf(IsNull([Date]),0,nz(DSum("[Credit]","BookKeeping",
    "[Date]<=#" & Format([Date],"mm/dd/yyyy") & "#"),0) -
    nz(DSum("[Debit]","BookKeeping",
    "[Date]<=#" & Format([Date],"mm/dd/yyyy") & "#"),0))[/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •