Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Unanswered: Query Calculating problem

    Hi there,
    I have a main form called 'Project', within the form 'Project' I have inserted a continuous subform called 'Subproject'. Within 'Project' is a numeric field called 'Headcount' and within the subform 'Subproject' is also a numeric field called 'SubProjectHeadcount'. In my query i want to be able to sum the total headcount for the project, i.e the Headcount field plus the SubProjectHeadcount field, but the problem that arises is that if there is more than one subproject than it sums the 'Headcount' field in the 'Project' form twice! i.e if the 'Headcount' field has the value 10, and in the subform there are two subprojects whose 'SubProjectHeadcount' values are 5 and 7, then my query should show the total headcount as being 22, but it returns a value of 32, because it adds the 10 from the 'Project' form twice. How can I overcome this problem?? Sorry if this was a bit long-winded!!
    Thanks for any comments or answers

    Cheers
    nia

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I don't fully get what's going on here. But the quick fix is to subtract the headcount field from your total sum.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Teddy
    I don't fully get what's going on here. But the quick fix is to subtract the headcount field from your total sum.
    I know what's going on ... But, I'm not saying ... A hint: How is the query constructed that performs this calculation? AND the really BIG hint: Why is the main form's count in the query???
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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