Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Unanswered: Help using COUNT with multiple subforms


    I'll try to make this as short as possible. I have one form with two subforms. Each subform populates its own table. The main forms primary key is the foreign key to the two subforms. Each subform has an autonum for its primary key. When I try to use the COUNT function on one of the subforms primary key field in a query it gives me the cartesian product.

    Here's an example if my explanation didn't make any sense. My main forms record Primary Key = 01 (Could be CustomerNo 01)
    Subform 1 has 3 records for CustomerNo 01. Their records primary keys being 11,12,13.
    Subform 2 has 4 records for this CustomerNo 01. Their records primary keys being 5,6,7,8.

    When I use COUNT on Subform 1's primary key field, I expect to get 3 but instead I get 12. Same thing happens when I run a count on Subform 2's primary key field. I expect 4 but get 12 instead. Perhaps it has to do with the relationship? I dunno Any explanation would be greatly appreciated. Thank you in advance.

    Last edited by bobbio; 06-23-04 at 13:34.

  2. #2
    Join Date
    Oct 2003
    Where are you counting. ? on the main form or on the subforms?

Posting Permissions

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