Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Counting Records in a Report (A2K SR2)

    I have a report that has a record counter in the report footer, using the following Control Source in an unbound text box: =Count(*). The report prints out base Purchase Order information (PO number, vendor, address, phone number, etc.) as well as all the line items associated with the purchase order. My goal with the record counter is to count ONLY the number of purchase orders, not the number of line items. However, the counter returns the number of line items, which greatly exceeds the number of actual purchase orders because each purchase order contains numerous line items. I know it must be syntax problem. Please help. Thank you.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Records in a Report (A2K SR2)

    In order to count all the Purchase Orders (not the associated Line Items), try adding a grouping level for Purchase Orders in the report. Place the Purchase Order information in the Purchase Order Group Header section and place the Count function in the Purchase Order Group Footer section. Your Detail section should contain only Line Item information.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Records in a Report (A2K SR2)

    Thomas,

    The report already has a Purchase Order Group Header section (for the PO information) and a Detail section (for the line items). When I place the counter in the PO Group Footer section, the count control simply returns the number of line items associated with each purchase order.

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Records in a Report (A2K SR2)

    I tested the following method with 6 POs and 14 Line Items and got the correct count of 6 POs.
    In the PO Group header, place an unbound text box with the properties:
    Name RecordCount
    ControlSource =1
    RunningSum Over Group
    Visible No
    In the report footer, place an unbound text box and set the Control Source to =[RecordCount].
    HTH

  5. #5
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Records in a Report (A2K SR2)

    Thomas,

    Thank you. Your method worked perfectly. Thanks for taking the time to come up with this solution.

Posting Permissions

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