Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    May 2002
    Posts
    36
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Count Records That Equal A Where Clause (97)

    I have an Access 97 report that I trying to add a where clause to a text box to count number of records that equal the criteria. For example, the Control Source in the Text Box is STATUS, which has an R or W status. I want the report to count the number of Rs. Any suggestions?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Count Records That Equal A Where Clause (97)

    If you group your report by STATUS, you can count the number of records in each group by putting a text box in the group footer with control source<pre>=Count(*)</pre>

    In this case, there is no need to add a where condition.

    If you don't want to group by STATUS, you can use a text box in the report footer with control source<pre>=DCount("*","RecordSourceName","STATUS= 'R'")</pre>

    where RecordSourceName should be replaced by the name of the record source of the report (table or query). Note the use of single quotes within the Where condition.

Posting Permissions

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