Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    292

    Unanswered: Count Help !! thanks

    I have a module which does a count..

    The count consist of all REcords that have a
    1) REJection of Yes
    2) first 2 letters of field 'INSP'

    Once the record is inputted by the user as REJ = Y, then someone has to go and and fix that record. Once that record is fixed, the user has to go back into the form and change the REJ = 'Y' to REJ = 'N' also place a check mark by the changed record to let management know that this record was wrong but now it is fixed.

    So now in my count I need All REJ of Y and the ones that were changed from Y to N.. I also need those in my count.. I tried a couple of ways but im getting the wrong answer on my report.

    my code
    Code:
    Function funCount3(prmSearchString2 As String) As Variant
        funCount3 = DCount("[INSP]", "[qryQualityStatus]", "left([INSP],2) = '" & prmSearchString2 & "' And [REJ] ='Y'")
    End Function
    tried
    Code:
    Function funCount3(prmSearchString2 As String) As Variant
        funCount3 = DCount("[INSP]", "[qryQualityStatus]", "left([INSP],2) = '" & prmSearchString2 & "' And [Fixed] =True OR [REJ] = 'Y'")
    End Function
    but doesnt work.. gettting wrong answer on report..

    On my report

    in txtboxes I have the code..

    =funCount3("DR") <~~ counts all DR in field INSP
    =funCount3("SO") <~~ counts all SO in field INSP

    now say that i have records like soo...

    [field] = INSP REJ FIXED
    [rec1] = DR12..N..(Checked)
    [rec2] = DR23..Y..(unchecked)
    [rec3] = DR45..N..(Unchecked)

    My report should count...

    DR = 2
    SO = 0

    but it prints out..

    DR = 2
    SO = 1

    I do not know why i'm getting a 1 in SO... i'm soo confused !!
    any help would be appreciated..

    thanks so much..

  2. #2
    Join Date
    Jul 2003
    Posts
    292
    bump*

  3. #3
    Join Date
    Jul 2003
    Posts
    292
    got it!

    order of expression problem..

    thanks

Posting Permissions

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