Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73

    Unanswered: Cannot Count Records in a Report

    I have a report that has a cbo that counts how many records meet a value, this fields comes straight from the Query.

    This works great:

    =-Sum([lhsperform]="1st Time Go") < gives me the correct value

    Now when I try to get a total for "1st Time Go" from a calculated field then it does not work.

    Note: txtgs is a calculated field that I have VB Fill in (1st Time go, 2nd Time Go) based on many variables

    =-Sum([txtgs]="1st Time Go") < does not work
    =Abs([txtgs]="1st Time Go") < This show just 1 record, should be 83

    Looking for suggestions

  2. #2
    Join Date
    Feb 2004
    Posts
    214

    ...

    Try =Nz(Sum([txtgs]="1st Time Go"))
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  3. #3
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73
    I tried but it prompts me for the field [txtgs], it seems like anytime I use SUM/count, it prompts me for the field

  4. #4
    Join Date
    Feb 2004
    Posts
    214

    ...

    make sure txtags is the name of the control (textbox, combo, etc...)
    sometimes it gives it a default name of Text15 or whatever.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  5. #5
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73

    Correct fields

    The fields names are all correct, it my other fields work fine, I am just having problems with this one because (I think) the field I want a result in is a calculated field in the detail, this one is in the footer. humm

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by PJHAction
    Now when I try to get a total for "1st Time Go" from a calculated field then it does not work.
    You've pinpointed the problem yourself! You cannot run Aggragate Functions, such as Sum(), DSum(), etc. against a Calculated Field, you have to run it against the calculation itself.

    For example, if

    txtgs = A + B + C

    you cannot do

    =SUM(txtgx)

    you have to do

    =SUM(A + B + C)
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73
    That did it, that was a nice lesson learned! We tend to look at Linear paths which can lead us to a path of resistance!

    Peter

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Actually, one of the things I like most about Access is that you can use it for years and still new things a bout it!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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