Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a continuous subform which has a field called "total_inv" (this is a calculated field that multiplies two other fields). I have been trying create a running total field in the Header section using =Sum([total_inv]) but I keep getting an error.

    I can't figure out what is causing the error. All I want to do is create a running total.

    Strangely, another calculated field on this subform that counts the number of records =Count([inv_no]) also returns an error. I can't figure that one out either.

    Any help is appreciated.

    JoeK

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You generally have to refer to fields in the record source of a form or report when using Sum, Count etc., not to calculated controls.

    Try using =Sum([Field1]*[Field2]), substituting the correct field names, instead of =Sum([total_inv]).

    To count the number of records, you can use =Count(*).

    Alternatively, you could calculate total_inv in a query that acts as record source of the subform. You can then use =Sum([total_inv]) and =Count([total_inv]) because total_inv is now a field in the record source.

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    Try using =Sum([Field1]*[Field2]), substituting the correct field names, instead of =Sum([total_inv]).

    To count the number of records, you can use =Count(*).
    These solutions worked really well. Thanks for your help.

    JoeK

Posting Permissions

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